Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
115 views
in Technique[技术] by (71.8m points)

java - Remote MYSQL Database Access

I have developed an application in java that access remote mysql database. While I am running it by netbeans IDE of system which have running that wamp server. But while i try I make connection in another system to remote system database by netbeans it shows following error.

Unable to add connection, Cannot establish a connection to jdbc:mysql://192.168.1.14:3306/test using(CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.

Please, kindly help me.

Thanks in Advance

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From mysql forums

You could be getting this because (1) the URL of the DB is wrong, because (2) the DB isn't set up to accept connections from the web host, or because (3) some intermediate networking component is misconfigured. (1) is your problem; (2) and (3) might be your problem or the web hosting's problem, depending on where the DB is located, what administrative privileges on the DB that you have, and how the networking is set up.

You need to have the right privileges to be able to connect to MySQL remotely. There are several tools available to set it up.

Here is an article outlining several steps of which the grant step is most commonly needed.

mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';

There has also been problems reported when connecting to MySQL databases in Windows Vista, but i'm not sure wether this is relevant to this case or not.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...