Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
Which distro are you running? Please post the entire error message (include error code)? –  quanta Aug 23 '11 at 14:43
add comment

2 Answers

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.