I came across this disgusting error message while try to connect to mysql in python 2.7.
In fact I wrote something like :
import MySQLdb
db = MySQLdb.connect(host="localhost", user="py", passwd="py", db="test")
You can get rid of the above mentioned error by just replacing the host: localhost by 120.0.0.1
import MySQLdb
db = MySQLdb.connect(host="127.0.0.1", user="py", passwd="py", db="test")
...
In fact I wrote something like :
import MySQLdb
db = MySQLdb.connect(host="localhost", user="py", passwd="py", db="test")
You can get rid of the above mentioned error by just replacing the host: localhost by 120.0.0.1
import MySQLdb
db = MySQLdb.connect(host="127.0.0.1", user="py", passwd="py", db="test")
...
I am getting same error for both cases
ReplyDelete