I am able to connect successfully to my database through localhost with my application. but I am trying to have that same application on another computer and share the same database with the first computer.
I am using wampserver 3.2.0 (64bit) and windows 10 pro.
This is what I tried:
- I went to httpd-vhosts.conf of my wampserver and changed 'Require local' to 'Require all granted'
- Then I went to my user account of wampserver and added an new user privilege, and replaced the hostname with '%' instead of 'localhost' with a new username and password.
- Typed ipconfig in CMD and copied my ipv4 address, into my connection URLin replacement of localhost. eg:
conn = DriverManager.getConnection("jdbc:mysql://192.168.0.1/mydatabase","user","pass");
This connection is for the app on the different computer, whilst maintaining localhost connection URL for the main computer which has the wampserver. Both computers are connected to the same wireless router.
Anytime I run the application on the other computer, I get this exception:
com.mysql.cj.jdbc.exexceptions.CommunicationsXeception:Communications link Failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not recieved any packets from the server