I had the same problem on a virtual machine running Ubuntu. After reading allenhighnote message, I realized my silly mistake.
I had changed the file: /etc/mysql/my.cnf to set bind-address to the IP that at that moment the virtual machine had, but when the DHCP assigned another IP the my.cnf was no longer valid. Solution: I changed the bind-address. |
You need to make sure MySQL is running:
sudo /etc/init.d/mysqld start |
Worked
Running /etc/init.d/mysqld start worked for me.
I guess mysql had stopped. |
Most Common Cause
There are various things that can cause this issue- obviously since we have so many different solutions being presented. I troubleshoot sites for a living and this is what I find to be the most common reason for this error.
When sql runs it creates temp files, one of these is the sock file mentioned within this error. Within your my.cnf file it is specified where sql attempts to find/write this file. First check your system to see where my.cnf is, if you can't find it- its because sql is not running and hasn't ran in the past. Check the path specific in your my.cnf, then check the owners on that directory. Usually this happens because the owners permissions are not quite right. Such as a mysql:root ownership. To fix it, simply run a chown mysql:mysql directoryname. Restart sql, service restart mysql, /etc/init.d/mysql restart, /etc/init.d/mysqld restart - usually one of those variations on linux. Hopefully this helps save some time. As I said there are numerous reasons, I find this is the most common. Especially if you've moved the install to another server. |
Hello, i solved that:
1.- In my.cnf changue 'localhost ip' to your IP (where you have your site installed) 2.- In mysql environment (when you access by mysql -u root -p) you give access to users not using 'localhost', use your IP. 3.- In your 'settings' or 'configuration' file (if you are using Wordpress, drupal,etc) you have to change 'loccalhost' for 'Your IP' Then you have a correct conecction. I think if you ddeactivate innodb it loss sense use mysql beacuse it's designed for innodb |
All times are GMT -5. The time now is 02:54 PM. |