简体   繁体   中英

MySQL server not accepting remote connections

I'm using the C++ connector and one of the example code that goes along with it and it wont allow external connections to connect to my database when i change the host address from localhost to my computer's address where the server is running.

This connects perfectly without any problems:

con = driver->connect("tcp://127.0.0.1:3306", "Shawn", "my_pass");

But obviously this wont work when i change computers, so i set the host address to my computer where the server is running like this:

con = driver->connect("tcp://108.xxx.xxx.xxx:3306", "Shawn", "my_pass");

* x's stand for numbers to hide my IP

Why won't it connect?

I allowed Norton 360(takes over windows firewall) to accept any and all connections and ports from my program.

I gave the user "Shawn" the privledges necessary to accept all hosts via "%":

http://i.imgur.com/F92qeua.png

I get this mysql error:

http://i.imgur.com/OMAhtpg.png

You can also pass Socket parameter with this connection string. or you can try with the hostname instead of ipaddress.

if still youre issue is not resolved .Firewalls/iptables are enabled at server side so u need to stop it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM