Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL no incoming connections - missing config file 1

Status
Not open for further replies.

Borvik

Programmer
Jan 2, 2002
1,392
US
Ok here is the situation.

I have a MySQL server successfully setup on a Fedora Core 4 box (I used the RPMs).

I have a separate box that hosts the webserver, and I want it to be able to connect to the remote MySQL server (both servers on the same LAN).

Now I can tell that the MySQL server is NOT listening for incoming connections:
Code:
# ps -eaf | grep mysql
root      2030     1  0 Jan10 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/servername.pid
mysql     2054  2030  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2057  2054  0 Jan10 ?        00:00:11 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2058  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2059  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2060  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2061  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2065  2057  0 Jan10 ?        00:02:03 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2066  2057  0 Jan10 ?        00:00:57 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2067  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2068  2057  0 Jan10 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2089  2057  0 Jan10 ?        00:00:01 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
mysql     2102  2057  0 Jan10 ?        00:00:01 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servername.pid --skip-locking
root     14958 14921  0 11:15 pts/1    00:00:00 grep mysql

I not sure where the server is pulling it's configuration from. Typically it is /etc/my.cnf - but that file doesn't exist. While that file doesn't exist, the server still runs - as I can connect to the localhost - just not from another machine.

I could just play with it and copy a configuration file - but I don't want to screw anything up.

What can I do to fix this properly?

Thanks.
 
No experience of Fedora all distros are slightly different in where they put things and the RPM might have reflected that.
Would be surprised if there was not a my.cnf somewhere have you searched for it with find.
Suspect it might be the script that starts the server that is passing parameters such as datadir if you are not.
As default my.cnf (and probably your script if there really is not my.cnf) will tend to have skip-networking which might explain why you can get at it only as localhost.
 
I did use "locate" to search for my.cnf and it turned up no results (after I ran updatedb).

I was able to locate the example configuration files in the mysql directory - but those are the example file and not used.

I had a feeling that the startup script may be passing some configuration info to it - but I looked through that and that is more than a little confusing.

Am I safe copying a configuration file (my-large.cnf) to /etc/my.cnf and editing it? If I copied it - would it use that configuration instead of the passed configuration from the startup script?
 
Yes
The example config files have some explanation of what they are. Assuming you are running a simple server the main section to look at and understand is [mysqld] and within this check the basedir datadir tmpdir point to the correct directories.
 
Alright - I'll give it a shot - thanks hvass.
 
I tried it and from the localhost (of the mysql server) I was able to do this:
Code:
# telnet 192.168.1.7 3306
Trying 192.168.1.7...
Connected to 192.168.1.7.
Escape character is '^]'.
A
5.0.19-standard-logM/;|}$5~=,Sj;(VW23JX[D^]
telnet> quit
Connection closed.
If I am correct - that means it IS listening on the network interface. It is possibly just a firewall issue now. As soon as I get nmap on the machine unable to connect I'll be able to test that for sure. I'll post back the results of that test.

Thanks for the help hvass - it did solve the TCP/IP problem (locally) - now I just got to solve it across the network.
 
Local firewall on server caused it - thanks for all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top