0

I'm trying to set up my server to accept remote connections to MySQL. It now works using this command within ssh : mysql -u testuser -h my.ip.address.here -p but when i try to do a mysqli connect using php, I get an error message:

Can't connect to MySQL server on my.ip.address.here

If I use mysql connect, I get Lost connection to MySQL server during query

If I telnet to my ip address on port 3306, I get the following:

Got packets out of order, connection to host lost

I thought this would be straight forward and it easy to get it connecting through ssh. I can connect fine using HeidiSql program also. I have Plesk installed on the IP address so maybe this is interfering but I wouldn't imagine so.

Anyone got any ideas as to what could be wrong?

1
  • 1
    Which distro are you running? Please post the entire error message (include error code)?
    – quanta
    Aug 23, 2011 at 14:43

2 Answers 2

1

If you do sudo netstat -lntp | grep 3306, what is the process that comes up(at the end)? Is it mysqld, or is it some Plesk process? If it is some Plesk process, then you will need to figure out how to either load all your tables into Plesk's MySQL instance, or figure out how to stop Plesk's MySQL and load all of its data into your instance of MySQL. mysqldump will be your friend here.

What are your iptables filters like? If you can, then try iptables -I INPUT -p tcp --dport 3306 -d my.ip.address.here -s your.originating.ip.address -j ACCEPT. This will allow traffic from your IP address to the host via the destination IP address on the port that MySQL uses.

0

In /etc/my.cnf, make sure that "skip-networking" is NOT commented out.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .