Connecting to ALL SQL Databases Remotely

Operating System & Version
CentOS 7 (CloudLinux 7.9)
cPanel & WHM Version
Latest (Updated 3 days ago)

RyanR

Active Member
Jul 22, 2020
43
5
8
London
cPanel Access Level
Root Administrator
Hi,

I'm trying to connect from my local system to all of the databases with HeidiSQL or dbForge the same as if I was to log into WHM and then click on phpMyAdmin.

I've added my IP to the Additional MySQL® Access Hosts page and applied it to all cPanel accounts, but if I try and connect it says that my access was deined, using password yes.

I've tried switching it to SSH tunnel but that too fails...

I can already connect to the server via SSH just fine, which did by setting up a wheel user that has a ssh key added to it, I then connect via ssh and enter my ssh keys password. Once logged in, I can run sudu su and gain access to root.

What's the solution to be able to connect and view all databases?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,629
363
cPanel Access Level
Root Administrator
Hey there! The Additional MySQL® Access Hosts area is for incoming connections to the server, so that won't help connect to an outbound server. To make a server-wide remote MySQL connection, you'll want to check out the details here:


Can you look that over and see if that helps?
 

RyanR

Active Member
Jul 22, 2020
43
5
8
London
cPanel Access Level
Root Administrator
I realize after sending that message that I may have misinterpreted your request. Are you trying to connect from your workstation to the server, or from your webserver to a separate MySQL machine?
Hi Rex,

Yep, I am indeed trying to connect from my workstation to the server. To essentially have a workstation version of phpmyadmin, rather than logging into WHM and visiting phpmyadmin.

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,629
363
cPanel Access Level
Root Administrator
Thanks for the confirmation. In theory, doing what you have done would let you access individual cPanel account databases. You would also want to make sure that port 3306 is open in the server's firewall.

I found this post regarding similar work here, so that may be worth checking out as well:


Just be sure to make a backup of any configuration files you edit, just in case.