LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-08-2006, 05:51 AM   #1
ganesh343
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Rep: Reputation: 0
Can't connect to local MySQL server through /mysql.sock


How can I fix this prblem??

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
-Ganesh
 
Old 06-08-2006, 06:59 AM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
is the mysqld process running ? Check this first by typing :
Code:
ps aux | grep mysqld
 
Old 06-08-2006, 11:39 PM   #3
ganesh343
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
[root@enter3 root]# ps aux | grep mysqld
mysql 5220 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
mysql 5222 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
mysql 5223 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
root 9389 0.0 0.1 1732 596 pts/0 S 10:08 0:00 grep mysqld
[root@enter3 root]#
 
Old 06-08-2006, 11:41 PM   #4
ganesh343
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I changed the 'datadir' on file /etc/my.cnf file.

then I started it with 'mysqld_safe'

Now its running on its own.
I dont know what happend.
- Ganesh
 
Old 06-08-2006, 11:45 PM   #5
ganesh343
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Anyway who ever is having problem with mysql.sock

Make sure the mysql base directory and mysql data directory should have the proper permissions.
- chown mysql.mysql <folder>
Forget about the creation of mysql.sock on your own. On mysql startup it creates this file.

So the error

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

is only because of permissions problem.
-Ganesh
 
Old 06-09-2006, 10:39 AM   #6
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
Quote:
is only because of permissions problem.
not only that was the point of my first question, cause it can also be the same error when the process isn't running

Ever hear of that saying, start with the easiest things first
 
Old 03-14-2007, 06:57 PM   #7
spooge
Member
 
Registered: Nov 2001
Location: n chicago, IL. USA
Distribution: Slackware
Posts: 307

Rep: Reputation: 31
a lil late for this thread, but i ran into the same problem.
everything was running fine and the mysql error popped up.

i mdified my my.cnf
Code:
skip-innodb
and this did the trick.

forgot where i found this
 
Old 07-13-2009, 10:05 AM   #8
litespeeder
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
create the mysql.sock with the following command

mysql -uroot -p -socket=/dbadmin/mysql/mysql01/run/mysql.sock
 
  


Reply

Tags
error, grep, mysql, mysqld, mysqlsock


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" vitopn Linux - General 3 05-21-2007 10:13 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

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

All times are GMT -5. The time now is 03:37 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