Looks like the DAL is using the pymysql driver, which is included in 
/gluon/contrib. If you've pulled the DAL out of /gluon and don't have 
pymysql, then it won't find the driver.

Anthony

On Saturday, April 7, 2012 11:26:25 AM UTC-4, mert.nuhoglu wrote:
>
> I installed web2py as source and wanted to use DAL without the rest of the 
> framework. 
>
> But DAL does not connect to mysql:
>
> >>> DAL('mysql://user1:user1@localhost/test_rma')
> ...
> RuntimeError: Failure to connect, tried 5 times:
> 'NoneType' object has no attribute 'connect'
>
>
>
> Whereas MySQLdb can connect to the database with the same credentials:
>
> >>> import MySQLdb
> >>> db = MySQLdb.connect(host='localhost', user='user1', passwd='user1',db
> ='test_rma')
>
>
>
> A similar 
> problem<http://stackoverflow.com/questions/7891376/web2py-wont-connect-to-mssql>with
>  MsSQL was solved by explicitly setting the driver object. I tried the 
> same solution:
>
> >>> from gluon.dal import MySQLAdapter
> >>> print MySQLAdapter.driver
> None
> >>> driver = globals().get('MySQLdb',None)
> >>> print MySQLAdapter.driver
> None
>
>
>
> But still the driver is None.
>
> Do you have any suggestion?
>

Reply via email to