Sponsored Content
Top Forums UNIX for Advanced & Expert Users I can't fire up MySql on my Fedora Server - Obvious config setting? Post 69515 by cbkihong on Friday 15th of April 2005 09:08:28 AM
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.
 
mysql(1)							  MySQL database							  mysql(1)

NAME
mysql_fix_privilege_tables - Fixes MySQL privilege tables. SYNOPSIS
mysql_fix_privilege_tables [mysql_root_password] DESCRIPTION
This scripts updates the mysql.user, mysql.db, mysql.host and the mysql.func tables to MySQL 3.22.14 and above. This is needed if you want to use the new GRANT functions, CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 If you get 'Access denied' errors, run the script again and give the MySQL root user password as an argument. SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
This manpage was written by Christian Hammers <ch@debian.org>. MySQL is available at http://www.mysql.com/. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 17 March 2003 mysql(1)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy