LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2010, 11:08 PM   #1
rathina.sok
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Rep: Reputation: 0
Red face Error mysql


Dear all,

Please everyone help me. I am now using SLES11. My web server now error mysql. However, when I restart mysql using "rcmysql restart" the message display:
Restarting service MySQL
Shutting down service MySQL done
Starting service MySQL done

..........................
but when I start to access via browser using my name virtual host (http://wordpress.group4.com) the message display "Error establishing a database connection"

when I go to mysql using command "mysql" the message display"
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

After that I try to edit file mysql.sock but on the bottom of file display message (permission denied)


Please you Tell me the easy way to fix these problem.

Sincerely,


Rathina
 
Old 08-15-2010, 11:24 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. You're exactly right: the best way to troubleshoot this problem is with the "mysql" client. You need to be able to "connect" with mysql before you go any further.

2. No, you don't need to "edit" '/var/lib/mysql/mysql.sock. It's automatically (re)created by MySQL every time you restart the server.

SUGGESTIONS:
3. This is good troubleshooting advice for "mysql 2002":
http://dev.mysql.com/doc/refman/5.1/...to-server.html

4. Check your MySQL configuration file (EX: /etc/my.cnf)
a) Make sure your "datadir" exists and is writable by mysql
b) Make sure the directory for your "socket" (EX: /var/lib/mysql) exists and is writable

5. Make sure you can "ping localhost" (and, hopefully, you'll get an address like "127.0.0.1" back)

'Hope that helps .. PSM

Last edited by paulsm4; 08-15-2010 at 11:35 PM.
 
Old 08-16-2010, 01:09 AM   #3
PhantasyConcepts
LQ Newbie
 
Registered: May 2009
Posts: 19

Rep: Reputation: 3
Quote:
Originally Posted by paulsm4 View Post
Hi -

1. You're exactly right: the best way to troubleshoot this problem is with the "mysql" client. You need to be able to "connect" with mysql before you go any further.

2. No, you don't need to "edit" '/var/lib/mysql/mysql.sock. It's automatically (re)created by MySQL every time you restart the server.

SUGGESTIONS:
3. This is good troubleshooting advice for "mysql 2002":
http://dev.mysql.com/doc/refman/5.1/...to-server.html

4. Check your MySQL configuration file (EX: /etc/my.cnf)
a) Make sure your "datadir" exists and is writable by mysql
b) Make sure the directory for your "socket" (EX: /var/lib/mysql) exists and is writable

5. Make sure you can "ping localhost" (and, hopefully, you'll get an address like "127.0.0.1" back)

'Hope that helps .. PSM
I have never used SLES, but in Slackware, before you use MySQL, you have to actually configure MySQL and create the database by running a few scripts. It sounds like you are trying to connect to an unconfigured MySQL instance. Been there, done that, go through it every time I install a new Slackware system and try running MySQL.
 
Old 08-16-2010, 03:10 AM   #4
rathina.sok
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Oh! I have already check /etc/my.cnf already exist and /var/lib/mysql also writable
and I also can ping to localhost with the message reply"64 bytes reply from localhost (127.0.0.1)....... but MySQL still not running and for "datadir" I don't understand whether you wanna talk about what?


Your truely,

Rathina

Last edited by rathina.sok; 08-16-2010 at 03:34 AM.
 
Old 08-16-2010, 11:10 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, again -

1. Please double-check my.cnf. Please make sure the socket file/path it specifies is the same one in the error message, and the same one you checked. In other words, please make sure there aren't TWO socket files somehow being created.

2. Look at these two log files for any MySQL-related errors or warnings:

# System log
/var/log/messages

# MySQL
/var/log/mysqld.log

3. Please DISABLE "AppArmour" (if only temporarily, for debugging/troubleshooting purposes) and see if that helps.

4. Look at these links:
http://lists.mysql.com/mysql/205056

http://www.linuxquestions.org/questi...-mysql-237016/

http://forums.mysql.com/read.php?11,27769,102905

'Hope that helps .. PSM
 
Old 03-13-2011, 09:00 PM   #6
rathina.sok
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Dear Paulsm4,

Thanks for your kindly help... I am sorry for being late reply . Your solution was very help full for me.

Best Regards,
Rathina SOK
 
Old 03-13-2011, 09:32 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,349
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Did this website ever work with wordpress?

If so and if it then stopped working, then it sounds to me, sadly, that the database may be severely damaged. Been there, done that.

If you have shell access to the server, logging into mysql from the command line and running mysqlcheck might turn up something.

Here is a website that discusses in clear terms ways to repair a mysql database.

http://www.felipecruz.com/repair-mysql-database.php
 
  


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
MySQL 5.0.67: Unable to install & run. Error /var/lib/mysql/mysql.sock' (2) peteyperson Linux - Server 2 03-04-2009 01:16 PM
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. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
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 - Newbie

All times are GMT -5. The time now is 12:31 AM.

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