mysql| Error | After I successfully installed mysql,apache,php on Linux, I edited a. php page that connected to the database, and reported the following error:
Can ' t connect to the local MySQL server through socket '/var/lib/mysql/mysql.sock '
I searched on the Internet, or a very typical mistake, I found some information on Google, a successful solution. I take the following methods:
Look at the MySQL error log to see what's going on, I'm here the error log is in/var/lib/mysql/*.err you'll find MySQL only so can't start because/var/lib/mysql permissions don't allow MySQL service access, English MySQL default is to invoke MySQL user to start the service. We just
Chown-r Mysql:mysql/var/lib/mysql
On the line, if you still can not start, and then slowly debug permissions, anyway, the general can not start is the issue of permissions.
If we still can not start, then use my more cumbersome permission settings, anyway, I do it every time, generally will not have problems, see below:
Chown-r Root/usr/local/mysql
Chgrp-r Mysql/usr/local/mysql
Chown-r Root/usr/local/mysql/bin
Chgrp-r Mysql/usr/local/mysql/bin
Chgrp-r Mysql/var/lib/mysql
chmod 777/var/lib/mysql
Chown-r Root/var/lib/mysql/mysql
Chgrp-r Mysql/var/lib/mysql/mysql
chmod 777/var/lib/mysql/mysql
Chown-r root/var/lib/mysql/mysql/*
Chgrp-r mysql/var/lib/mysql/mysql/*
chmod 777/var/lib/mysql/mysql/*
chmod 777/usr/local/mysql/lib/mysql/libmysqlclient.a