Markus
Markus

Reputation: 407

Java MySQL Connects not to other server

I'm trying to create a sql connection to another server with the default jdbc drivers but the applications connects alwas to the localhost. I've tryed it on tow different machines.

Here is my code

 DriverManager.getConnection("jdbc:mysql://yourname.xyz:3306/database?serverTimezone=UTC&useSSL=true", "user", "password");

Please help me :)

Regrads

Upvotes: 0

Views: 31

Answers (1)

Tom Klein
Tom Klein

Reputation: 36

Verify your hostname, port, database name and so on and tell us if there's something wrong with it.

Upvotes: 1

Related Questions