| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-20-2009, 04:24 AM
|
#1
|
|
LQ Newbie
Registered: Jul 2009
Posts: 6
Rep:
|
Lost connection to MySQL server at 'reading initial communication packet', system err
Hi All,
I am connecting mysql database server through php script remotly. PHP files on other server and the database is on another. While trying to connect, i get this error message below.
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 113
Please suggest me how to get it connected.
Thanks in advance
|
|
|
|
07-20-2009, 05:30 AM
|
#2
|
|
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware, Cross Linux from Scratch, Gentoo
Posts: 2,663
Rep: 
|
Are you using iptables and does iptables allow MySQL connections?
|
|
|
|
07-20-2009, 05:47 AM
|
#3
|
|
Member
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381
Rep:
|
Try telnet to port of mysql defaults to 3306
|
|
|
|
07-20-2009, 06:18 AM
|
#4
|
|
LQ Newbie
Registered: Jul 2009
Posts: 6
Original Poster
Rep:
|
I am not using IP tables. also i tried telnet, it says "connection to host lost"
Last edited by manishsingh4k; 07-20-2009 at 06:27 AM.
|
|
|
|
07-20-2009, 06:44 AM
|
#5
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,797
|
Does your MySQL server listens on the IP or only on the localhost? Check my.cnf to find out.
Kind regards,
Eric
|
|
|
|
07-20-2009, 06:53 AM
|
#6
|
|
Member
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381
Rep:
|
Are you able to ping the server which hosts mysql
|
|
|
|
07-20-2009, 07:08 AM
|
#7
|
|
LQ Newbie
Registered: Jul 2009
Posts: 6
Original Poster
Rep:
|
please suggest how to view/modify the my.cnf, also how can we see the settings of IP / localhost. Yes I am able to ping the server which hosts mysql
Last edited by manishsingh4k; 07-20-2009 at 07:11 AM.
|
|
|
|
07-20-2009, 07:14 AM
|
#8
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,797
|
Hello,
On a default installation, depending the distro you use, the file you need to check is found in /etc/mysql and named my.cnf.
If that directory doesn't exist, look for the file using find / -name 'my.cnf' and you'll know where it is.
So 'cd' to the directory or edit using your favorite editor (vi, nano, ...).
Look for the line that says
bind-address =
If that is set to 127.0.0.1 or something else, change it to the IP of your server. The IP of your server should be known by you, or can be found using 'ifconfig' command (on Debian) or with 'ip addr sh eth0' for the first network card.
After changing the my.cnf file you need to reboot the MySQL server, normally using '/etc/init.d/mysql restart'
Kind regards,
Eric
Last edited by EricTRA; 07-20-2009 at 07:15 AM.
|
|
|
|
07-20-2009, 07:31 AM
|
#9
|
|
Member
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381
Rep:
|
Provide the IP of the machine from which you are making the connection.
The user from which you are making the connection
and the output of this query
Code:
select host,user,Select_priv from mysql.user;
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:29 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|