Connect on remote MySQL database through Python

后端 未结 4 1558
栀梦
栀梦 2020-12-09 09:33

I have tried the following script but unfortunately doesn\'t work. I am using a free MySQL database provider. Any ideas?

import MySQLdb

myDB = MySQLdb.conne         


        
4条回答
  •  猫巷女王i
    2020-12-09 09:50

     GRANT ALL
     ON  *.*
     TO user@192.168.39.17  -- client ip address
     IDENTIFIED BY 'pwd';
    

    Edit

    This is SQL that you'd run on the database in order to ensure that the user has access to everything. pwd is the user's password.

    Basically, this answer assumes that the connection issue is a credentials issue.

提交回复
热议问题