so I tried to connect to my local host with the 3306 port, and it works fine. Now, I'm using my second computer to connect to the database remotely.
Two computers can't have same IP. Check the second for IP address using ifconfig
command (if you have *nix system).
Follow this instructions:
Client PC:(sample ip: 192.168.0.105 want yo connect to mysql server on 192.168.0.172)
- Java app: user: dbuser, pass: dbpass, host: 192.168.0.172
Mysql Server PC:
- On mysql console: GRANT ALL PRIVILEGES ON *.* TO dbuser@192.168.0.105 identified by "dbpass";
FLUSH PRIVILEGES;
Now you have all set to make a remote conection from your client to your mysql server.
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.