ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.
Linux - SoftwareThis 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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Thanks a million for your response. I changed the spelling, but then when i try to start mysql it is still giving me the same error. Is there anything else obvious that you can thing of that I may not be doing?
Are you sure the daemon is running? Many distributions do not start the daemon by default. You might run a test. The actual starting of the daemon is controlled by a script located in the init.d directory. (It will either be /etc/init.d/mysqld or /etc/rc.d/init.d/mysqld). As root attach to that directory and then issue ./mysqld start. If that works, you should modify the startup scripts to automatically start the daemon. Perhaps the easiest way is to use the graphical tools under kde or gnome to modify the services (daemons) that start. Good luck
This can happen when the user (in the current case user 'mysql') doesn't have permissions to write to the directory where the lockfile should be created.
Either set permissions to the given location so that mysql can write to it, or choose another location by changing the my.cnf file.
run 'ls -l /var/lib' and 'ls -l /var/lib/mysql' to see the ownership and permissions of that directory and it's contents.
error: 'Can't connect to local MySQL server through socket '
i am stuck with this error ... its detail is as follows.
1. I installed EL5 then i check for mysql...
[root@localhost Server]# rpm -ivh mysql-*
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package mysql-5.0.45-7.el5 is already installed
Q1. Does it mean that mysql is installed or not?
2. I have no entry in /etc/init.d/ for mysql or mysqld.
[root@localhost ~]# /etc/init.d/mysql
-bash: /etc/init.d/mysql: No such file or directory
[root@localhost ~]# /etc/init.d/mysqld
-bash: /etc/init.d/mysqld: No such file or directory
3.When i tried this
mysqladmin -u root password mysqldata
i got [root@localhost ~]# mysqladmin -u root password mysqldata
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
First of all you shouldn't reply to such an old post. It's better to create a new one to get the responses that might help you.
Anyway, to answer your question, you need to install also the server package named mysql-server.