sysr-q / pysqlw

Python based MySQL and SQLite wrapper.
MIT License
3 stars 1 forks source link

Exception: Unable to connect to database. (mysql) #3

Open xnzj opened 8 years ago

xnzj commented 8 years ago

pysqlw version 1.3

import pysqlw

conf = {
    "db_type": "mysql",
    "db_host": "localhost",
    "db_user": "root",
    "db_pass": "root",
    "db_name": "test"
}
p = pysqlw.pysqlw(db_type="mysql",db_host="localhost",db_user="root",db_pass="root",db_name= "test")

Traceback (most recent call last):
  File "E:/py_code/keyword/copy_article_and_comment.py", line 11, in <module>
    p = pysqlw.pysqlw(db_type="mysql",db_host="localhost",db_user="root",db_pass="root",db_name= "test")
  File "C:\Python27\lib\site-packages\pysqlw\pysqlw.py", line 58, in __init__
    raise Exception('Unable to connect to database. ({0})'.format(self._db_type))
Exception: Unable to connect to database. (mysql)
Exception AttributeError: "mysqlw instance has no attribute 'dbc'" in <bound method pysqlw.__del__ of <pysqlw.pysqlw.pysqlw instance at 0x000000000269CAC8>> ignored

can't connect to mysql, I don't know how to fix it ! Please help .

sysr-q commented 8 years ago

What version of MySQLdb are you using and how did you install it? The no attribute 'dbc' error suggests it might be something outside of my control.