Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)The solution was simple, just start MySQL :)
--
Did you know you can help educate the world through your bookmarks? Join my alpha project featuring social media tools (OpenEncyclopaedia.com) and share your bookmarks while educating the world.
11 comments:
OS error code 13: Permission denied
Therefore, the above definitely not THE ONLY cause.
But, one of the cause.
Thanks Smile Dreamz for pointing it out. I wasn't able to publish your comment because I am in the process of moving.
Error code 13 can be caused if:
- user/host permissions are wrong
- file permissions are wrong
- mysql not running
Thanks again
Frank
there is another case when you get this error even if mysql server is running. You should check if you compiled PHP with --enable-sockets option
frankly speaking I have been looking for hours for a solution to the mysql.sock (13) error and with your three lines you provided enough clues as to how to correct the problem. In my case the problem was in fact a user (group) permission error and not any one the many other possible problems. Thanks again for your insight.
With fedora 6 you need disable SE Linux !
Thanks, Boris for the big help.
I have Fedora 3 with SELinux enabled, which was also the problem. The solution was to set "SELINUX=disabled" on the the configuration file /etc/sysconfig/selinux.
More info about disabling SELinux here:
http://docs.fedoraproject.org/selinux-faq-fc3/index.html#id2825945
Re-iterating Phil,
THANKS BORIS,
Without you, I would never have thought of a potential problem with selinux enabled.
But indeed I had one.
mysql.sock (13) error
the true answer, it's here:
http://docs.fedoraproject.org/selinux-faq-fc3/index.html#id2825945
Tanks!! the solution for this problem is: DISABLE SELINUX
Thank you so much! I spent over an hour trying to find this problem. selinux was the problem.
It it helps anyone:
* I was connecting to a remote SQL server
* Connected to SQL server fine from other sources
* Connected fine from web server using mysql command line
* Connected fine from web server using php in command line mode
* Would NOT connect from web server using php from page running under apache
Hi,
thanks a lot.. your solution was very useful. I tried many other options on my application but nothing worked. Simple yet very useful.
Post a Comment