mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.

Mysql installation on Linux <CentOS> server, by itself due Centos yum Mysql branch source Mariadb replaced MySQL, so had to choose embodiment rpm or tar.gz package installation,

But in order to later in other LInux such as Ubuntu installation are also proficient in MySQL, it is recommended to use tar.gz, installation guide -http: //blog.csdn.net/qq_32331073/article/details/76252559

Run the command: service mysqld start

The following error:

MySQL.Logging to Starting '/usr/local/mysql/data/iZ2ze8hspx8qsmxx7b1i9sZ.err'.
170 728 09:47:55 mysqld_safe Directory '/ var / lib / MySQL' File for UNIX socket do not EXISTS.
 ERROR! At The Server quit . without updating PID file (/usr/local/mysql/data/iZ2ze8hspx8qsmxx7b1i9sZ.pid)
then execute the command: cat /usr/local/mysql/data/iZ2ze8hspx8qsmxx7b1i9sZ.err view the error cause
error reads as follows:

[ERROR] Can't start server : Bind on unix socket: Permission denied
[ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
结合先前写入配置/etc/my.cnf:

Not difficult to understand from the above -

the first:

Directory mysqld_safe '/ var / lib / MySQL' File for UNIX socket do not EXISTS.
    "var / lib / MySQL" directory does not exist, first create:

   mkdir / var / lib / mysql
second:

     Mysql client and server communication is carried out by mysql.sock initialization file, the server at startup to write to the file, the file is stored in the directory must both

Have access. The exception log, said:

[ERROR] Can not start server: Bind on unix socket: Permission denied
     it, MySQL service does not have write access to the directory / var / lib / mysql, the file can not be generated mysql.sock, natural service can not find the file at startup.

     To the directory / var / lib / mysql paid to write permissions or the maximum authority -chmod 777 / var / lib / mysql

finally:

Published 51 original articles · won praise 9 · views 40000 +

Guess you like

Origin blog.csdn.net/weixin_39891030/article/details/89330896