If you still receive the socket error, double check the location where your MySQL installation is looking for the socket file. This information can be found in the mysqld. Look for the socket parameter in the [mysqld] section of this file. It will look like this:. Close this file, then ensure that the mysqld. If the file does not exist, the reason may be that MySQL is trying to create it, but does not have adequate permissions to do so. Then ensure that the mysql user has the appropriate permissions over the directory.
Setting these to will work in most cases:. Then try accessing the MySQL prompt once again. Where would you like to share this to? Twitter Reddit Hacker News Facebook. So start the server using one of the following commands. Maybe someone facing this problem. I am using Mysql Workbench on Ubuntu 14 and got this error. See other answers for a permanent solution.
In My case two mysqld processes were running.. This approach might help when the socket is not created at all, but really this might not not be the real problem, there is an underlying problem. I had the exactly same issue. After struggling for an hour, I found a way of correcting it without reinstalling mysql-common, mysql-client, mysql-server.
You will find that the mysql. Simply remove the entire mysqld directory and recreate it and provide it necessary privileges. Now, Kill the mysql process in it's entirety. I found this error when connecting database through terminal. If you don't want to type socket path everytime, then go for changing default path in my. Provide permissions and restart mysql server. Edit: Recently I've installed Ubuntu Its working like a charm without any problems. I uninstalled mysql in Ubuntu I would also check the mysql configuration.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 3 months ago. Active 24 days ago. Viewed 1. I finally decided to uninstall and reinstall mysql. Improve this question. I got the same problem.
I solved it just now. Anto This is not a duplicate. The problem you linked has that file. None of the answers here or anywhere else I could find solved my problem. Add a comment. Active Oldest Votes. Try this command, sudo service mysql start. Improve this answer. Joe Cheng Joe Cheng 7, 3 3 gold badges 23 23 silver badges 23 23 bronze badges.
I tried the accepted answer but couldn't find the mysql. Thank you — Giovanne Afonso. I had to use sudo service mysqld start — Gavin Miller. If you hit this issue, by all means, run this simple command FIRST before testing the other stuff, it only takes a second, and if the server simply isn't running, and is fine after you start it, it just means it didn't autostart, which would then be the actual problem to solve.
Show 2 more comments. Then, stop the mysqld process. How you do this will vary by system. Ray Ray Please don't recommend using kill -9 ; there are several ways that should be tried before it has to come to that. Once you find it you might need to edit your my. Here's the commands I ran: "sudo service mysql stop" and "sudo mysqld --skip-grant-tables".
I can't find this. InnoDB: Check that you do not already have another mysqld process — dot. Show 9 more comments. This error occurs due to multiple installations of mysql. Run the command: ps -A grep mysql Kill the process by using: sudo pkill mysql and then run command: ps -A grep mysqld Also Kill this process by running: sudo pkill mysqld Now you are fully set just run the following commands: service mysql restart mysql -u root -p Have very well working mysql again.
Hammad Raza Hammad Raza 1, 1 1 gold badge 9 9 silver badges 11 11 bronze badges. Hey folks, I was running all over the web trying to fix this.
My problem was that I was trying to setup docker. I wanted it to use the mysql data dir that was previously used by mysql outside of docker Job for mysql. See "systemctl status mysql. Tnx, you save my time. Show 3 more comments. Can't initialize character set. File Not Found and Similar Errors.
Administration-Related Issues. Problems with File Permissions. How to Reset the Root Password. Case Sensitivity in String Searches. Problems with Column Aliases. Rollback Failure for Nontransactional Tables. Deleting Rows from Related Tables. Solving Problems with No Matching Rows.
0コメント