Ok. I've managed to connect to MySQL from GAE local dev server on Windows if I change line 3845 in dal.py to this:
self.folder = "" instead of (self.folder = folder or '$HOME/'+thread.folder.split('/applications/',1)[1]) I don't know if it breaks anything though. On Thu, Aug 9, 2012 at 6:03 AM, Alexei Vinidiktov < alexei.vinidik...@gmail.com> wrote: > The problem is still not resolved in trunk. > > > On Mon, Aug 6, 2012 at 12:56 PM, Alexei Vinidiktov < > alexei.vinidik...@gmail.com> wrote: > >> Here it is: db = DAL('google:sql://vocabilisproject:vocabilis/vocabilis') >> >> I pass the password and the user name via App Launcher parameters as >> suggested in the GAE SDK docs: --mysql_user=root --mysql_password=xxxxxx >> --mysql_host=localhost --mysql_port=3306 >> >> >> On Mon, Aug 6, 2012 at 7:59 AM, Massimo Di Pierro < >> massimo.dipie...@gmail.com> wrote: >> >>> Can you show your complete connection string (masking any password of >>> course)? >>> >>> >>> On Saturday, 4 August 2012 02:11:30 UTC-5, Alexei Vinidiktov wrote: >>>> >>>> >>>> >>>> On Sat, Aug 4, 2012 at 1:56 PM, Alexei Vinidiktov < >>>> alexei.vinidik...@gmail.com> wrote: >>>> >>>>> Hello, >>>>> >>>>> I'm need hep figuring out how to set up a local GAE development server >>>>> with MySQL. >>>>> >>>>> MySQL connection parameters are specified via App Launcher application >>>>> settings: --mysql_user=root --mysql_password=xxxxxx --mysql_host=localhost >>>>> --mysql_port=3306 >>>>> >>>>> When I launch my web2py app with GAE Launcher on my local Windows >>>>> box I get this erorr message: >>>>> >>>>> ############ >>>>> ERROR 2012-08-04 06:28:43,515 dal.py:5962] DEBUG: connect attempt >>>>> 0, connection error: >>>>> Traceback (most recent call last): >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 5955, in __init__ >>>>> self._adapter = ADAPTERS[self._dbname](*args) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 3310, in __init__ >>>>> self.folder = folder or '$HOME/'+thread.folder.split('** >>>>> /applications/',1)[1] >>>>> IndexError: list index out of range >>>>> ############# >>>>> >>>>> What does the following line do? >>>>> >>>>> self.folder = folder or '$HOME/'+thread.folder.split('** >>>>> /applications/',1)[1] >>>>> >>>>> If I comment out "or >>>>> '$HOME/'+thread.folder.split('**/applications/',1)[1]" >>>>> in DAL.py and relaunch the dev server, the application appears to be able >>>>> to connect to MySQL but then I get a different error message: >>>>> >>>>> ######## >>>>> INFO 2012-08-04 06:42:35,142 rdbms_mysqldb.py:102] Connecting to >>>>> MySQL with kwargs {'passwd': 'xxxxxx', 'unix_socket': '', 'host': >>>>> 'localhost', 'port': 3306, 'user': 'root'} >>>>> ERROR 2012-08-04 06:42:35,153 warnings.py:29] >>>>> C:\Users\alexei\Dev\web2py\voc**abilis.net >>>>> <http://vocabilis.net>\gluon\dal.py:1386: >>>>> Warning: Can't create database 'vocabilis'; database exists >>>>> ret = self.cursor.execute(*a, **b) >>>>> >>>>> ERROR 2012-08-04 06:42:35,575 restricted.py:155] Traceback (most >>>>> recent call last): >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\main.py", >>>>> line 510, in wsgibase >>>>> session._try_store_in_db(**request, response) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\globals.py", >>>>> line 561, in _try_store_in_db >>>>> record_id = table.insert(**dd) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 6829, in insert >>>>> return self._db._adapter.insert(self,**self._listify(fields)) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 928, in insert >>>>> raise e >>>>> ProgrammingError: (1146, "Table 'vocabilis.web2py_session_**vocabilis' >>>>> doesn't exist") >>>>> ######### >>>>> >>>>> The vocabilis database does exist. It was created earlier when I >>>>> connected to MySQL from a non GAE environment. >>>>> >>>>> If I specify a different non-existent database in the connection >>>>> string, then after relaunching the application vith the GAE Launcher I get >>>>> this error message: >>>>> >>>>> ####### >>>>> INFO 2012-08-04 06:44:45,415 rdbms_mysqldb.py:102] Connecting to >>>>> MySQL with kwargs {'passwd': 'xxxxxx', 'unix_socket': '', 'host': >>>>> 'localhost', 'port': 3306, 'user': 'root'} >>>>> ERROR 2012-08-04 06:44:45,828 restricted.py:155] Traceback (most >>>>> recent call last): >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\main.py", >>>>> line 510, in wsgibase >>>>> session._try_store_in_db(**request, response) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\globals.py", >>>>> line 561, in _try_store_in_db >>>>> record_id = table.insert(**dd) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 6829, in insert >>>>> return self._db._adapter.insert(self,**self._listify(fields)) >>>>> File >>>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>>> line 928, in insert >>>>> raise e >>>>> ProgrammingError: (1146, "Table 'vocabilis3.web2py_session_**vocabilis' >>>>> doesn't exist") >>>>> ####### >>>>> >>>>> So the application appears to be unable to create the session table. >>>>> >>>>> I'm running Windows, Python 2.7, web2py 1.99.7, MySQL 5.5 >>>>> >>>>> >>>>> >>>> I had a connection string with "migrate_enabled=False". I tried >>>> removing it, then I got this error message: >>>> >>>> ########################### >>>> ERROR 2012-08-04 07:07:40,513 restricted.py:155] Traceback (most >>>> recent call last): >>>> File "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net> >>>> \gluon\restricted.**py", line 205, in restricted >>>> exec ccode in environment >>>> File "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net> >>>> \applications\**vocabilis\models\db.py", line 23, in <module> >>>> session.connect(request, response, db = db) >>>> File >>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\globals.py", >>>> line 488, in connect >>>> migrate=table_migrate, >>>> File >>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>> line 6320, in define_table >>>> polymodel=polymodel) >>>> File >>>> "C:\Users\alexei\Dev\web2py\vo**cabilis.net<http://vocabilis.net>\gluon\dal.py", >>>> line 707, in create_table >>>> % (table._db._uri_hash, tablename)) >>>> File "C:\Python27\lib\ntpath.py", line 96, in join >>>> assert len(path) > 0 >>>> TypeError: object of type 'NoneType' has no len() >>>> ########################### >>>> >>>> >>>> -- >>>> Alexei Vinidiktov >>>> >>> -- >>> >>> >>> >>> >> >> >> >> -- >> Alexei Vinidiktov >> > > > > -- > Alexei Vinidiktov > -- Alexei Vinidiktov --