Status
Not open for further replies.

rioweb

Registered
Jan 28, 2005
1
0
151
Hello,

i do it below:
======================================================
When connecting to a MySQL database on a given server from a different server, replace "localhost" with the IP address of the machine running the MySQL database.

In the MySQL section in Cpanel, you'd need to add the IP of the machine from which you want to access the database in the "Access hosts" section.

To give an example:

Server A with IP address 123.123.123.123 is running a MySQL database
Server B with IP address 231.231.231.231 wants to access the MySQL database on server A.

When connecting to the MySQL database on server A from server B, replace "localhost" in the MySQL connect command with 123.123.123.123.

In Cpanel on server A, add the IP address 231.231.231.231 (server B) to the "Access hosts" section on the MySQL page.

========================================================

This is my script to connect:
========================================================
$conec = mysql_connect('123.123.123.123',"login","passwd") or print (mysql_error());


if($conec){
echo "SUCESS";
}else{
echo "FAIL";
}

mysql_select_db('data_base',$conec) or print(mysql_error());

=========================================================
I get conect to mysql with SUCESS, but when I will select the database him mistake comes back.

Access denied for user 'user'@'231.231.231.231' to database 'painel_novadm'



Which is the problem?
 

rhysmcmurdo

Member
Apr 12, 2006
13
0
151
My Quick and nasty patch is as follows...

Scroll down to line 648 of /usr/local/cpanel/Cpanel/Mysql.pm and below the line:

$priv =~ s/_priv//;

Insert the following 2 lines:

$priv =~ s/_/ /;
$priv =~ s/tmp_table/temporary tables/;
 

zenpig66

Active Member
Nov 16, 2002
43
0
156
Just so you or anyone else is curious, this did resolve the same issue for me...thanks for the patch. Has this been resolved in any CPanel update?....release, current, edge, etc?
 

iUnknown

Member
Jul 11, 2008
20
1
51
I get this exact problem, and apparantly it is fixed, even in stable releases? How can I fix it?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Please open a support ticket for this issue. This thread is nearly 2 years old.
 
Status
Not open for further replies.