PyMySQL can't connect to MySQL on localhost

后端 未结 8 1881
囚心锁ツ
囚心锁ツ 2020-11-28 08:26

I\'m trying to connect to MySQL on localhost using PyMySQL:

import pymysql
conn = pymysql.connect(db=\'base\', user=\'         


        
8条回答
  •  执念已碎
    2020-11-28 08:44

    I asked why socket worked but not TCP and the answer was that bind-address in /etc/my.cnf was not set correctly. This could be your problem too since the socket methods works just fine but the TCP one does not.

提交回复
热议问题