MySQLdb in Python: “Can't connect to MySQL server on 'localhost'”

后端 未结 6 960
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 10:15

I have installed MySQLdb for Python and I am able to import MySQLdb. Now I try to connect to the MySQL Community Server on my local machine, using this code:



        
6条回答
  •  没有蜡笔的小新
    2020-12-08 11:01

    If you are using windows you should specify the IP to "127.0.0.1", using "localhost" will give you that error 2003. On Ubuntu I had no problem.

提交回复
热议问题