Remotely Connect to MySQL database on cPanel using Java

mobcdi

Well-Known Member
Jul 13, 2009
109
0
66
I'm trying to allow a java app to connect to a cPanel accounts mysql database but am not sure if I have all the steps and settings correct.

I've added the remote database access hosts to WHM and cPanel but am not sure of the connection url that the jdbc client needs to access the database

Is there ports I have to open in addition to the step above?
Is there a way to get the required jdbc connection string for each database?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
What is the connection string you are trying currently for the connection? Of note, you'd need to connect to a database user and password for that database user. The database user must already existing in cPanel > MySQL databases area and must already be added to the MySQL database.
 

mobcdi

Well-Known Member
Jul 13, 2009
109
0
66
Had the database username & password created and had the connection string nearly correct but instead of jdbc:mysql://remoteserver/ I should have had jdbc:mysql://remoteserver/dbname

The 1st url passed a basic connection test but didn't get to the database when it came time to actually interact with the database