mysqld_safe error: log-error set to '/data/log/mysqld.log', however file don't exists. Create writable for user 'mysql'.The server quit without updating PID file (/data/mysql/mysqld.pid)

[oot@cent65 bin]# service mysqld start
Starting MySQL.2019-10-28T15:56:47.786960Z mysqld_safe error: log-error set to '/data/log/mysqld.log', however file don't exists. Create writable for user 'mysql'.
The server quit without updating PID file (/data/mysql/mysqld.pid).[失败]

[root @ cent65 bin] # Touch /data/log/mysqld.log
After you add files, log the error did not, pid there, also lacks permission to see the problem, once again authorized or not. . .
Wherein datadir = / data / mysql

[@ cent65 the root log] # CD / Data / MySQL
[@ cent65 the root MySQL] # LL
Total amount 110 652
-rw-56 is R & lt MySQL MySQL. 1 ----- 10 00:12 auto.cnf dated 29
-rw --- ---- 1 mysql mysql 1676 00:12 CA-10 Yue key.pem 29
-rw-r - r-- 1 MySQL MySQL 1112 00:12 ca.pem 10 Yue 29
-rw-r - r-- 1 mysql mysql 1112 10 00:12 Client-cert.pem dated 29
-rw ------- MySQL MySQL. 1 1680 10 00:12 Client-dated the key.pem 29
-rw-R & lt MySQL. 1 ----- mysql 425 10 00:12 ib_buffer_pool dated 29
-rw-R & lt ----- 10. 1 MySQL MySQL 12,582,912 dated ibdata1 00:12 29
-rw-R & lt ----- 10. 1 MySQL MySQL 50331648 dated ib_logfile0 00:12 29
- rw-r ----- 1 mysql mysql 50331648 ib_logfile1 00:12 on October 29
drwxr X-4096 --- 2 MySQL MySQL MySQL 00:12 on October 29
drwxr-X --- 2 MySQL MySQL 4096 Oct 29 00 : 12 performance_schema
-rw ------- 1 mysql mysql 1680 10 00:12 private_key.pem dated 29
-rw-R & lt - r-- MySQL MySQL. 1 452 10 00:12 public_key.pem dated 29
-rw-r-- r-- 1 mysql mysql 1112 10 00:12 Server-cert.pem dated 29
-rw ------- MySQL MySQL. 1 1676 10 00:12 Server-dated the key.pem 29
drwxr-X --- 2 MySQL mysql 12288 dated 10 SYS 00:12 29
[@ cent65 the root MySQL] # pwd
/ Data / MySQL
[@ cent65 the root MySQL] # chown -R & lt MySQL: MySQL / Data / MySQL
[@ cent65 the root MySQL] -R & lt # the chmod 755 / the Data / MySQL
[root @ cent65 MySQL] #
above reauthorization do not remember there is no verification ...
I am angry! Executed directly below. . .
[cent65 the root @ ~] # chown -R & lt MySQL: MySQL / Data
[@ cent65 the root ~] # the chmod 775 / Data
[@ cent65 the root ~] # -Service Start mysqld
Starting the MySQL [OK].

So, from the Internet to push lightly in a circle, to try basically try
cause of the problem summary of ash often in place

The likelihood of problems
1, may be / usr / local / mysql / data / data directory mysql user does not have permission (to modify the data directory permissions)
The solution: give permission, the implementation of "chown -R mysql.mysql / usr / local / mysql / data "and then restart mysqld

2, the process may already exist mysql process
Workaround: use the command "ps -ef | grep mysqld" to see if there mysqld process, if you are using "kill -9 process ID to" kill, then restart mysqld!

3, may be the second time to install mysql on the machine, residual data affected the start of the service.
Solution: mysql binary log directory to see if there is mysql-binlog.index, quickly to remove it now

4, uses the configuration file mysql /etc/my.cnf not specify the configuration file at startup, open the file to view in [mysqld] case there is no specified data directory (datadir).
Solution: This line set [mysqld] at: datadir = / usr / local / mysql / data

5, skip-federated field problems
Solution: Check /etc/my.cnf file has no skip-federated field has not been commented out, if it is immediately commented.

6, the error log directory does not exist
Workaround: Use the "chown" "chmod" command and authority conferred mysql owner

7, selinux to blame, if the system is centos default will open selinux
Solution: temporary to warning mode: [root @ www php] # setenforce 0
and then open the / etc / sysconfig / selinux, the SELINUX = enforcing changed SELINUX = disabled

8, failed to start pay attention to check the data directory permissions to run the same program with mysql user privileges.
[root @ db01 mysql] # chown -R mysql.mysql ../mysql
preferably a full program mysql mysql directory will empower users.

Original link: https: //blog.csdn.net/eagle89/article/details/79813405

Guess you like

Origin www.cnblogs.com/ritchy/p/11756510.html