LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Python-Mysqldb Error in Ubuntu (https://www.linuxquestions.org/questions/programming-9/python-mysqldb-error-in-ubuntu-4175529745/)

jerseyqueen 01-01-2015 02:10 PM

Python-Mysqldb Error in Ubuntu
 
I work on an web project.I try to connect web.py to mysql, but I take an error like this:


Traceback (most recent call last):
File "project.py", line 17, in <module>
db = web.database(dbn='mysql', user='..', pw='..', db='..')
File "//web/db.py", line 1143, in database
return _databases[dbn](**params)
File "//web/db.py", line 975, in __init__
import MySQLdb as db
File "//MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: _mysql: init failed

astrogeek 01-02-2015 10:54 PM

Quote:

Originally Posted by jerseyqueen (Post 5293755)
ImportError: _mysql: init failed

Are you sure the MySQL database has been initialized and the server is running?


All times are GMT -5. The time now is 09:47 AM.