LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) (http://www.linuxquestions.org/questions/linux-software-2/problems-with-mysql-on-suse-cant-connect-var-lib-mysql-mysql-sock-244581/)

neocookie 10-19-2004 07:39 AM

Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock)
 
Hi all

Having trouble with my SuSE box. Basically, MySQL doesn't want to play ball unless I manually start it.

Currently when I try to connect to mysql (using the CLI) after boot (using root) I get the following message:
Code:

ERROR 2002: Can't connect to local MySQL server through '/var/lib/mysql/mysql.sock' (2)
I can start mysql using the following command: mysqld_safe --user=mysql&

This is a development server, so needs to boot MySQL during startup.

Can anybody help me?

bathory 10-19-2004 07:51 AM

Find a file named mysql.server and create a symlink to this file in rc5.d or rc3.d (rc5 for x-windows and rc3 for command line login)
Code:

ln -s /path/to/mysql.server /etc/init.d/rc5.d/S99mysql
Make sure that mysql.server is executable (chmod +x mysql.server)

neocookie 10-19-2004 08:09 AM

Worked a charm! Thanks!

MediMania 10-21-2004 10:50 AM

really Stuck with mysql.sock
 
hi all,

im a very newbie that got really badly stuck with this mysql.sock.....
so, i'm workin on a redhat 9....and i'm trying to set up ACID on snort.....usin mysql

all installation went fine, but when i try:
$mysql

i get an error:
ERROR 2002: Can't connect to local MYSQL server through socket '/tmp/mysql.sock'

I can't find this mysql.sock :( (neither find / nor locate worked)

looked for a while on the web, & tried all the different options proposed:

edit etc/my.cnf
change /tmp/ to /var/lib/mysql/

:scratch:

what am i supposed to so it work....

& when using the apache server to connect acid....guess what, i get the same error

plz, help:confused:

bathory 10-22-2004 01:54 AM

First of all don't change any config file yet because the error means that perhaps the daemon is not running. Check to see if mysqld is running:
Code:

ps -ef|grep mysqld
and if it's running then try to figure out what's wrong

MediMania 10-22-2004 03:58 AM

i can't even lunch the mysql deamon....& 'im gettin the same error....I even tried reconfiguring with specifying the path of mysql.sock...... & still doesn't work.....

& it's not the hard drive problem.....

bathory 10-22-2004 04:34 AM

Did you follow the instructions for the installation of mysql? After the installation you must run the ./mysql_install_db script to create the initial users db and after that you must start the daemon with something like: ./safe_mysqld &
So undo the changes you made in my.cnf run those scripts (if not done yet) and if you get this error again take a look at the error logfile created in the directory you specified during installation for keeping the data. The file is named something like: hostname.err
Good luck

donnelly886 10-27-2004 02:02 PM

Awesome!!
 
Bathory you hit it! I was having the same problems with Suse 9.1 and mysql.

I kept getting:
ERROR 2002: Can't connect to local MySQL server through '/var/lib/mysql/mysql.sock' (2)
after installing mysql through YAST.

The exact line in needed was:

ln -s /usr/share/mysql/mysql.server /etc/init.d/rc5.d/S99mysql

I was trying to figure this out for days!!! Thanks

utkarshcse 02-07-2008 11:48 PM

Quote:

Originally Posted by neocookie (Post 1243173)
Hi all

Having trouble with my SuSE box. Basically, MySQL doesn't want to play ball unless I manually start it.

Currently when I try to connect to mysql (using the CLI) after boot (using root) I get the following message:
Code:

ERROR 2002: Can't connect to local MySQL server through '/var/lib/mysql/mysql.sock' (2)
I can start mysql using the following command: mysqld_safe --user=mysql&

This is a development server, so needs to boot MySQL during startup.

Can anybody help me?

Hey I also find the same error over SUSE Linux in . If anybody have idea about this error and removal of it please help.

Utkarsh


All times are GMT -5. The time now is 12:55 PM.