MySQLdb connection problems

后端 未结 7 1065
逝去的感伤
逝去的感伤 2020-12-30 05:37

I\'m having trouble with the MySQLdb module.

db = MySQLdb.connect(
    host = \'localhost\', 
    user = \'root\', 
    passwd = \'\', 
    db = \'testdb\',          


        
7条回答
  •  死守一世寂寞
    2020-12-30 06:05

    add unix_socket='path_to_socket' where path_to_socket should be the path of the MySQL socket, e.g. /var/run/mysqld/mysqld2.sock

提交回复
热议问题