Connect on remote MySQL database through Python

后端 未结 4 1559
栀梦
栀梦 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条回答
  •  难免孤独
    2020-12-09 10:02

    open your database in mysql and type the following :

    mysql> GRANT ALL ON *.* TO root@'x' IDENTIFIED BY 'Your-password'
    

    where x is the ip address of the user that wants to access your db.

    use this link for more information: How to Allow MySQL Client to Connect to Remote MySQL server

提交回复
热议问题