On TurnkeyLinux I have tried to connect a Web2Py app to the MySQL instance 
(which is up and running) with the following DAL statement (in db.py):

db = DAL('mysql://root:pwd2sql@web2py/dbname', fake_migrate_all=True)

I have queried the MySQL for the information:

select @@hostname; 

select database();

And then have substituted in the above DAL connection string.

It doesn't work and throws the following ticket:

Failure to connect, tried 5 times: Traceback (most recent call last): File 
"/var/www/web2py/gluon/dal.py", line 7562, in init self.adapter = 
ADAPTERSself._dbname File "/var/www/web2py/gluon/dal.py", line 2572, in 
__init_ if do_connect: self.reconnect() File 
"/var/www/web2py/gluon/dal.py", line 606, in reconnect self.connection = 
f() File "/var/www/web2py/gluon/dal.py", line 2570, in connector return 
self.driver.connect(*driver_args) File 
"/usr/lib/python2.7/dist-packages/MySQLdb/init.py", line 81, in Connect 
return Connection(args, *kwargs) File 
"/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in 
init super(Connection, self).init(args, **kwargs2) OperationalError: (2003, 
"Can't connect to MySQL server on 'web2py' (111)")

Does anybody have a connection string sample I can use ?

Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to