Remote MySQL server + "Add a New IP Address" messes up

Eiler

Member
Oct 18, 2010
14
0
51
I've set up the remote mysql server - that works without any issues exactly as I want it too. But when I add a new ip address to the system, so a shared hosting client of mine can get a dedicated ip address, and tries to open phpmyadmin in whm, the I'm presented with the following error:


Error

SQL query: Edit

SET CHARACTER SET 'utf8';

MySQL said:

#1130 - Host 'new.ip.new.ip' is not allowed to connect to this MySQL server


Why is this? I were expecting cPanel to automatically take care of this. Also I don't understand why the mysql server thinks I'm accessing it form the newly added ip address instead of the primary ip address set for the cpanel server (which is working fine).

Any help or good ideas will be very appreciated :) Thanks!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you add that dedicated IP in WHM > Additional MySQL Access Hosts area, does it then work?
 

Eiler

Member
Oct 18, 2010
14
0
51
The issue was caused by network protocol. The new IP is on the same subnet as the remote MySQL IP. The main ip of the cPanel server is on a different subnet than the mysql server and the new ip. As such, the new IP takes precedence as the outbound route to connect to the MySQL server.

It appears that WHM :: Main >> SQL Services >> Additional MySQL Access Hosts added extra users for all the database users, just not root.

eg. A user as seen in phpmyadmin

Apartart xxx.xxx.1.1 Yes USAGE No Edit Privileges Edit Privileges Export Export
Apartart xxx.xxx.2.1 Yes USAGE No Edit Privileges Edit Privileges Export Export

vs root

root 127.0.0.1 No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
root xxx.xxx.1.1 Yes ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
root localhost No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export

I added [email protected].2.1 to the mysql userlist and phpmyadmin worked after that.


After that, it worked. So because the new ip was on the same subnet as the mysql server, and cPanel's main ip is not, the new ip was considered the "main" ip by the mysql server, which caused the problem as this didn't have access to it.
 

mvel001

Member
Sep 8, 2011
17
0
51
cPanel Access Level
Website Owner
Hello People, I also have a problem with "Additional MySQL Access Hosts" feature.

I got to CONNECT to MySql database ( $db = mysql_connect(this-host,user,passw) which runs successfully on remote serve)

but... it can´t SELECT a database into ( mysql_select_db(database-name,$db) fails )

I tried user = database-name owner and also user = root , but both failed.

When executing on "localhost" mode mysql_select_db works fine

what would be happening here? , I searched cPanel for some "additional database access hosts" or something else, but nothing found. Permissions appears given for entire mysql connections and not for specific databases. I have permission for remote mysql , but not for selected database.