I can't fire up MySql on my Fedora Server - Obvious config setting?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users I can't fire up MySql on my Fedora Server - Obvious config setting?
# 1  
Old 04-15-2005
I can't fire up MySql on my Fedora Server - Obvious config setting?

Hiya All,

I can't fire up MySql on my FC-3 Server at work.

I get the Error message at the end of this post.


Looks like some Config problem on the Server itself. (Ie web server and MYSQL is all on the same box. I get the same errror when trying to fire up MYSQL at the Box, as well as when dialled in remotely.)


Is it something Obvious I need to do wrt to Config etc?
(I made a std install, with all the SQL database options included!)


Please can you advise what files to look at etc!


Cheers
Martin

ERROR
--------
[root@localhost bin]# mysql

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
# 2  
Old 04-15-2005
This error means that the MySQL client is unable to connect to the server. In your case, both client and server resides on the same machine.

The most common causes for this errors are:

1) The server is not started at all, for whatever reasons. Do a netstat to find out if port 3306 is being listened to, i.e.

netstat -tln

should give you a line like

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

No such line means the server is not started at all.

2) If MySQL is not running, try to start it by using the start up script in /etc/init.d or /etc/rc.d (or similar), like

/etc/init.d/mysql start

If it cannot be started for whatever reasons, errors will be recorded in the log. Find out where. For MySQL shipped in Linux distribution, a popular location is somewhere like /var/log/mysql. You can (perhaps) find out where it is by locating the mysqld binary (you may need to browse the package database to find out if that comes from an RPM) and issue a command like

Code:
cbkihong:~# /usr/local/share/mysql/bin/mysqld --help | grep ^log-error
log-error                         /var/log/mysql/cbkihong.err

I have set my error log manually to /var/log/mysql/cbkihong.err on my local machine with a my.cnf so it points to there.

3) Another culprit is that the client is not configured to use the correct socket file. You can find out the socket file the server uses by a similar command

Code:
cbkihong:~# /usr/local/share/mysql/bin/mysqld --help | grep ^socket
socket                            /var/run/mysqld/mysqld.sock

Make sure this matches the socket file specified to the client, i.e. for your case both should point to /var/lib/mysql/mysql.sock.

You may try to follow these lines and see if it works for you.

Does your MySQL come with the distribution? Note that even if MySQL comes right out of the box its configuration is not necessarily correct. I have once used an early version of SuSE and MySQL failed to start due to improper permissions installed by the RPM packages. I usually install manually from MySQL.com.
# 3  
Old 04-15-2005
hiya cbk!

How you mate! Smilie

Cheers for the info - I'll store For reference!

Sorted it.

ADD APLICATIONS >> MySQL >> Properties


It had missing items for some reason!
Ticked all of them... as you do

working now! 8)


Cheers
Martin

PS:
The windows way of doing it I know - but just learning the systems at mo! ;-)
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question