HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Using remote MySql from ISPConfig server (http://www.howtoforge.com/forums/showthread.php?t=53257)

liloman 29th June 2011 02:24

Using remote MySql from ISPConfig server
 
Hi all,

I updated my ISPConfig to the last version 3.0.3.3
I created a client with his respective database. The database has in the Remote Access IPs textfield the IP of an external hosting.

The idea is using this mysql database in another external hosting to manage a forum.
The problem is that I'm not abble to use in my external hosting the mysql server (provided by the ISPConfig).

I filled up all the parameters in the config.php in my forum with the IP, user and password info.

When I try to acces to the forum it doesn't work. My Internet browsers says "The connection has been reset".


What I'm doing wrong?

It is possible to use the mysql server in another server? They are in separate networks.

liloman 29th June 2011 03:17

I realized a simple test with another external hosting trying to obtain simple records from my mysql server.
I finished all the lines which try to conect to DB with the function "or die (mysql_errno());"

The result when I go to test.php is:

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /XXXX/test.php on line 10
Lost connection to MySQL server at 'reading initial communication packet', system error: 111

In the line 10 there's the 1st sentence connection:
mysql_connect($dbhost,$dbuser,$dbpasswd) or die (mysql_errno());

I have to say the external hosting is not a slave of the mysql server. I mean, I have just ISPConfig in the mysql server. The other hosting is a VPS so I can't install anything else.
The forum is running in the VPS. As traffic has increase I need a powerful mysql server to respond all the user petitions. So I chose a dedicated server running the ISPConfig just to bring the DB.


Should I configure something else in the ISPConfig to be able to acces to its mysql from another server which is outside its network?

till 29th June 2011 10:47

Have you configured mysql to allow connections from other hosts in my.cnf file and did you open the mysql port in the firewall if you use one? Please post the output of:

netstat -tap | grep mysql

and also the output of:

iptables -L

liloman 29th June 2011 12:43

Netstat output:
Code:

tcp        0      0 localhost.localdo:mysql *:*                    LISTEN      26163/mysqld


Firewall output:
Code:

Chain INPUT (policy ACCEPT)
target    prot opt source              destination
fail2ban-ssh  tcp  --  anywhere            anywhere            multiport dports ssh

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination

Chain fail2ban-ssh (1 references)
target    prot opt source              destination
RETURN    all  --  anywhere            anywhere


I read out about commenting the bind line. I did it. I restarted the mysql server (after creating a new password for the root user).

With that, the currenlty nestat result is:
Code:

tcp        0      0 *:mysql                *:*                    LISTEN  31153/mysqld
The comand "cat php.ini | grep sql.safe.mode" results:
Code:

sql.safe_mode = Off

But I'm still getting an error when I try to access to the test.php:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'XXXX'@'XXXX.com' (using password: YES) in /X/test.php on line 10
Access denied for user 'XXXX'@'XXXX.com' (using password: YES)

I use the correct user/password.
Is that messages only a credentials error or a misconfiguration of the mysql/web server?

till 29th June 2011 15:40

Try to use the IP address to connect to the server instead of using the hostname.


All times are GMT +2. The time now is 03:39.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.