LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-19-2004, 07:39 AM   #1
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Rep: Reputation: 30
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?
 
Old 10-19-2004, 07:51 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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)
 
Old 10-19-2004, 08:09 AM   #3
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Original Poster
Rep: Reputation: 30
Worked a charm! Thanks!
 
Old 10-21-2004, 10:50 AM   #4
MediMania
LQ Newbie
 
Registered: Oct 2004
Location: Morocco
Distribution: FC 4
Posts: 11

Rep: Reputation: 0
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/



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
 
Old 10-22-2004, 01:54 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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

Last edited by bathory; 10-22-2004 at 04:25 AM.
 
Old 10-22-2004, 03:58 AM   #6
MediMania
LQ Newbie
 
Registered: Oct 2004
Location: Morocco
Distribution: FC 4
Posts: 11

Rep: Reputation: 0
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.....
 
Old 10-22-2004, 04:34 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 10-27-2004, 02:02 PM   #8
donnelly886
LQ Newbie
 
Registered: Oct 2004
Posts: 2

Rep: Reputation: 0
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
 
Old 02-07-2008, 11:48 PM   #9
utkarshcse
LQ Newbie
 
Registered: Dec 2007
Posts: 1

Rep: Reputation: 0
Cool

Quote:
Originally Posted by neocookie View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
can't connect to mysql through socket '/tmp/mysql.sock' Boby Programming 2 05-23-2004 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration