Spring Boot Connection to MySQL on remote SSH server - mysql

I am trying to connect to MySQL server at remote machine using spring-boot application.properties but it is failing with error o.s.b.a.orm.jpa.DatabaseLookup: Unable to determine jdbc url from datasource.
My database URL is in the correct format. Remote Server requires ssh connection and I have connected it successfully using MySQL Workbench. For connection via spring-boot app, I checked solutions and implemented JSCH solution as explained in post:
Spring Boot SSH Mysql? but still no success.
Remote Server SSH port is 202 instead of default 22. Any help on how to connect DB?

Please refer information mention here -
here
or
stackoverflow page

Related

JetBrains can not connect with a Hosted MySQL Database

I have a MySQL-Database from a hostingservice (strato.de). I try to connect the JetBrains DataGrip with this MySQL Database. I tried to connect but I get everytime a timeout. So I tried it with SSH but there I got this error:
[08001] Could not create connection to database server. Attempted
reconnect 3 times. Giving up. java.io.EOFException: Can not read
response from server. Expected to read 4 bytes, read 0 bytes before
connection was unexpectedly lost.
I do not understand the problem... is the Firewall blocking the connection?
How can I connect JetBrains with my Hosted MySQL-Database?
Make sure your hosting provider exposed MySQL database port for external connections.
Have you tried to connect via MySQL Workbench?
Just in case read JetBrains help topic

AWS connect to database

I created a database on AWS - RDS.And created a nodes app.
On MySql Workbench localhost I connected to database using endpoint and it was success and I got data on localhost/users
I deployed the nodejs app server to AWS but I did not get any data when I tried to call https://xalynj2ul4.execute-api.us-west-2.amazonaws.com/staging/users.
Try white-listing your node server in mysql host config file by entering your server ip in it

How to create a proxy connection on mysql workbench

My company is using http proxy connection to connect through the internet. I am trying to connect to my RDS MySQL instance on AWS by using MySQL Workbench. However, I get failed error. I need to configure my workbench to connect through my company http proxy.
Any suggests how?
Best Regards
Fady

Cannot connect to Azure MySQL service with MySQL Workbench

I'm using MySQL Workbench on a 64bit/Win 8.1 machine to trying to connect to an Azure MySQL service, but everytime I get the following error:
Lost connection to MySQL server at 'reading authorization packet', system error:0
I followed many tutorial found ever the internet, and I also tried to disable temporarely the firewall: most of them says that the only needed parameters are:
hostname (the one given in Azure portal/MyDB/Properties)
username (the one given in Azure portal/MyDB/Properties)
(optional) password (to store in vault)
I tried also using different connection methods (Standard TCP/IP and Local socket/pipe, as suggested here) but nothing.
Can help?
I was not able to recreate your issue. Here are the steps that I tried with a MySQL database created thru the Azure portal.
Open MySql Workbench.
Setup new connection with the following settings.
Hostname: HOSTNAME
Port: PORT
Username: USERNAME
Pasword: PASSWORD
Database: DATABASE NAME
Test Connection > Succeeded.
The settings above came from portal.azure.com > MyDatabase > All settings.
One suggestion is to contact ClearDB support. You can login to ClearDB from your database's Azure dashboard by clicking on Manage Database. From there you can go to Support and log a support incident.
I was also struggling with a similar issue, as I was not able to connect my MySQL workbench with Azure VM that's running MySQL.
I've contacted the Azure support to help me out after trying it for 3-4 hrs.
They suggested me to go into network security group of that VM, and add 3306 or whatever port that your MySQL is running on our Azure to the inbound and outbound list and add the exception as All.
It helped me to connect MySQL workbench with Azure VM with MySQL on it.

MySQL connection works for Workbench but not Tomcat Application using same credentials

I am working on a remote Redhat system over SSH. Tomcat 7 and MySQL 5.5 server are both installed and appear to be running correctly.
I can connect to MySQL from a local install of Workbench over SSH tunneling using localhost and a defined MySQL user. I can run queries and navigate tables without incident.
When I try to connect to the same MySQL Server with a Tomcat application running in the same environment using the MySQL defined user (same credentials) that Workbench is connecting with successfully, it fails.
At this point I don't know the exact error message that gets generated (I am not an admin) so any guidance here is appreciated.
My question is why can I connect with Workbench (which is effectively connecting locally), but not with my Tomcat application, which actually is local to the server?
Might it be a permissions issue with the context Tomcat is running under?
References:
Connection string example (credentials have been altered):
jdbc:mysql://localhost/mysql_database_name?user=ApplicationUsername&password=ApplicationPassword"
Furthermore, I have verified that
mysql-connector-java-5.1.27-bin.jar
is in the WEB-INF folder, and:
Class.forName("com.mysql.jdbc.Driver");
resolves.
This web application works in both dev and test on another server connecting using respective credentials.
Be sure the port number of mysql server exists in connection string. Normally if port is not specified, default value would be used as 3306. Maybe your mysql runs on different port?
jdbc:mysql://[host][,failoverhost...][:port]/[database] ยป
[?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
If the host name is not specified, it defaults to 127.0.0.1. If the port is not specified, it defaults to 3306, the default port number for MySQL servers.