i have this database on another pc and i want to access it by using a connection string like this.
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://192.168.0.1/dbtina","root","1234");
the "dbtina" is our database. the "1234" is our password. and we have configured our ip to be like that because we are using a wired connection (peer to peer).
Exception: Communications link failure
Last packet sent to the server was 0 ms ago.*
how do i fix this?
Simply disable firewall. or open the port 3306 for mysql use this link if it helps
manually open port
even after doing this you might get security exception. use mysql GRANT
query to give permissions.
mysql> GRANT ALL PRIVILEGES ON db_base.* TO db_user @'ip_address' IDENTIFIED BY 'db_passwd';
grant example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With