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

后端 未结 6 949
没有蜡笔的小新
没有蜡笔的小新 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:13

    In Windows 32, if you set host as 127.0.01 it gives the down error:

    OperationalError: (2005, "Unknown MySQL server host '127.0.01' (0)")
    

    But if you set host as 127.0.0.1 then you get no error.

提交回复
热议问题