LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-09-2007, 04:23 AM   #1
rwhite7890
LQ Newbie
 
Registered: Jun 2005
Posts: 28

Rep: Reputation: 15
MySQL ERROR 2002 (HY000)


I have installed MySQL. I have switched the socket file to /tmp/mysql.sock. When I issue the command: mysql -u root -p mysql, and after typing pw, I get the following:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Very strange. Mysqld is running as mysql. I have correct permissions on the directories:
mysql:/ > ll -d /tmp
drwxrwxrwt 13 root root 4096 2007-11-09 02:00 /tmp
root:~ > ll /tmp/mysql.lock
srwxrwxrwx 1 mysql mysql 0 Nov 9 02:02 /tmp/mysql.lock

user mysql is in group mysql and the server is running.

Not sure at all why this is happening. When I connect to the server like this: mysql -u root -h 127.0.0.1 -p mysql, then it works.

What is going on here? Does someone know the issue? I have never ran into this before....

Thanks...
 
Old 11-10-2007, 04:49 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The file in /tmp is called mysql.lock is that correct? Shouldn't that be mysql.sock? You can give it (mysql.sock) any name you want, but it should be consistent. Check your /etc/my.cnf to see if all(!) socket entries are set correctly.

Hope this helps.
 
Old 11-10-2007, 12:48 PM   #3
rwhite7890
LQ Newbie
 
Registered: Jun 2005
Posts: 28

Original Poster
Rep: Reputation: 15
MySQL ERROR

Thanks for noticing that! It usually always is something so simple it is looked over. I did have the wrong name of the sock file.

Thanks....
 
  


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
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq mimique Linux - Software 23 08-14-2012 06:14 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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 11:46 AM
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.so amee_stars Linux - Newbie 2 01-22-2007 02:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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