MySQL TCP Connection

2019-08-05 12:26发布

问题:

I have a MySQL Database which I want to connect to from a different computer, preferably using TCP/IP. What is the easiest way to do this. Currently I have tried just putting the IP address of the computer in, and it comes up with Error #1130, which is no help.

Any nice easy ways to do this?

回答1:

Make sure "skip-networking" is not in your my.cnf file (restart MySQL if it is after changing it), and that you've created a user with permissions to connection from your remote host. Something like:

GRANT SELECT,INSERT,UPDATE,DELETE ON mydb.mytable TO "myuser"@"myotherhost" IDENTIFIED BY "somepassword";