0

I have deployed my app on RaspberryPi server which demands connection to remote MySql db. The properties looks like:

# LOCAL DATABASE
#spring.datasource.url = jdbc:mysql://localhost:3306/test3?autoReconnect=true&useSSL=false
#spring.datasource.username = root
#spring.datasource.password = admin

# REMOTE DATABASE
spring.datasource.url = jdbc:mysql://modraszka.sth.sth:8822/test3?autoReconnect=true&useSSL=false
spring.datasource.username = root
spring.datasource.password = password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

But while I try to run the app it throws that: enter image description here

The remote DB is on the same server as app was deployed.

bielas
  • 672
  • 2
  • 12
  • 29

2 Answers2

0

Seems your host mane is not valid one (modraszka.sth.sth).

  1. Try to ping it.
  2. If its working try to telnet using telnet modraszka.sth.sth 8822.
  3. If telnet is not working try to telnet to telnet modraszka.sth.sth 22.

Then its not works for you we can assume you have to grant access to mysql port in the remote server.

  • I can ping and telnet it. According to access I have granted the user some time ago so I have all privilidges – bielas May 09 '17 at 06:46
-1

Check if your remote database is open for the internet or as it's default, running only localy

grant remote access of MySQL database from any IP address

Community
  • 1
  • 1
  • It is because when I create a tunnel and map it to localhost:9000 and run app locally it works. But now I want t run app from server which connects to the DB - which is also at the same server – bielas May 08 '17 at 19:25