Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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)
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.