Mysql Error 2002 /var/run/mysqld/mysqld.sock
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) up vote 185 down vote favorite 62 I installed LAMP on Ubuntu12.04 LTS (Precise Pangolin) and then set root password on phpMyAdmin. I forgot the password and now I am unable to login. When I try to change password through terminal I get: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) How can I fix this? I am unable to open LAMP, uninstall it or reinstall it. mysql phpmyadmin lamp mysql-error-2002 share|improve this question edited Mar 13 at 1:06 Braiam 3,27582656 asked Jul 25 '12 at 20:10 sushmit sarmah 1,1492912 Probably reinstall it is easier: stackoverflow.com/a/31984482/763744 –Zernel Aug 13 '15 at 9:34 Reset the password by stopping MySQL and starting it in safe mode skipping the --grant tables –davejal May 29 at 21:58 add a comment| 57 Answers 57 active oldest votes 1 2 next up vote 129 down vote I once had this problem and solved it by installing mysql-server, so make sure that you have installed the mysql-server, not the mysql-client or something else. That error means the file /var/run/mysqld/mysqld.sock doesn't exists, if you didn't install mysql-server, then the file would not exist. But if the mysql-server is already installed and is running, then you need to check the config files. The config files are: /etc/my.cnf /etc/mysql/my.cnf /var/lib/mysql/my.cnf In /etc/my.cnf, the socket file config may be /tmp/mysql.sock and in /etc/mysql/my.cnf the socket file config may be /var/run/mysqld/mysqld.sock. So, remove or rename /etc/mysql/my.cnf, let mysql use /etc/my.cnf, then the problem may solved. share|improve this answer
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] MySQL ERROR 2002 (HY000): Can't connect to local... Having an Issue http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Page 1 of 5 123 ... Last Jump to page: Results 1 to 10 of 50 Thread: MySQL ERROR 2002 (HY000): Can't connect to local... Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode https://ubuntuforums.org/showthread.php?t=804021 Switch to Threaded Mode May 23rd, 2008 #1 sevenearths View Profile View Forum Posts Private Message Visit Homepage Gee! These Aren't Roasted! Join Date Feb 2008 Location Swansea Beans 144 DistroUbuntu 9.04 Jaunty Jackalope MySQL ERROR 2002 (HY000): Can't connect to local... I upgraded to 8.04 recently and during the upgrade process Ubuntu asked me if I wanted to change one of my mysql configuration files and I must have clicked yes which is why I am in a bit of a pickle now. I currently get the following when I try to log in: Code: arthur@localhost:/etc/mysql$ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) And my /etc/mysql/my.cnf is as follows: Code: # # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually un
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://askubuntu.com/questions/92326/cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysqld-sock hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question http://dba.stackexchange.com/questions/98467/how-to-solve-cant-connect-to-local-mysql-server-through-socket-error _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) up vote 0 down vote favorite I've been mysql error struggling with this issue for a really long time. Can someone please advise me on how to get mysql working? root@me:~# start mysql start: Job is already running: mysql root@me:~# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) What boggles the mind is that it shows no mysql processes being run even though the above bash says otherwise. ~# ps -ef | grep mysql root 8968 1631 0 15:24 pts/0 00:00:00 grep --color=auto mysql bash mysql error 2002 command-line mysql share|improve this question asked Jan 2 '12 at 23:22 user784637 2,125113243 Does this file exist? /var/run/mysqld/mysqld.sock Delete it. It is a stale socket file. Then try to start. –user8290 Jan 3 '12 at 0:08 mysqld directory is already empty =( –user784637 Jan 3 '12 at 0:13 Hmm? This is for the socket file. 'ls -la /var/run/mysqld/mysqld.sock' Got it? Delete it. –user8290 Jan 3 '12 at 0:21 already tried that =( –user784637 Jan 3 '12 at 0:36 OP are you still looking for an answer? If so, you may need to repost your question as this is flagged for closure. Regards, –Ringtail Mar 28 '12 at 0:29 add a comment| 5 Answers 5 active oldest votes up vote 1 down vote check following steps:- 1) in my.cnf check the scoket location 2)check the mysql data directory permissions . 3)use following if u don't have password mysql -uroot -p password:just press enter share|improve this answer answered Jan 9 '12 at 6:59 kiran 111 add a comment| up vote 1 down vote use the command sudo nano /etc/mysql/my.cnf and change the bind address to your local host or 127.0.0.1 then save and close the my.cnf window. Then run the below command sudo service mysql start then try login mysql -u root -p share|improve this answer answered Aug 4 '14 at 5:41 Karthick 1274 not working for me. &ndas
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to solve “Can't connect to local MySQL server through socket” error? up vote 2 down vote favorite 1 I kept getting this following error every time I tried to restart MySql. It was working fine before I changed the default data directory. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib /mysql/mysql.sock' (111) I know there are other solutions posted by others but none of them worked for me. mysql errors connections startup share|improve this question edited Apr 22 '15 at 14:04 Md Haidar Ali Khan 1,4001823 asked Apr 21 '15 at 19:59 MahuLovzYou 11112 add a comment| 4 Answers 4 active oldest votes up vote 4 down vote Check the folowing First check if another instance is runnig in the same machine ps ax | grep mysql Then, check if your file my.cnf (probably in /etc/mysql/ folder) is correctly configured with [mysqld] datadir = /var/lib/mysql/ socket = /var/lib/mysql/mysql.sock Next, you have changed the default data directory, did you gave the right permissions to the new directory now chown mysql:mysql -R /var/lib/mysql/* chmod 755 -R /var/lib/mysql/* After changing the permission restart the service and check service mysql restart share|improve this answer edited Apr 22 '15 at 13:07 answered Apr 22 '15 at 12:52 Kaka DBA 34619 add a comment| up vote 2 down vote It would appear that the socket file is mis