MySQL 启动日志报错:Starting MySQL. ERROR! The server quit without updating PID file

Posted 健康平安的活着

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL 启动日志报错:Starting MySQL. ERROR! The server quit without updating PID file相关的知识,希望对你有一定的参考价值。

一 问题描述

1.1 问题描述

1.首先通过切换到mysql数据库所属用户: hd-mysql

[root@localhost local]# su hd-mysql

2.启动mysql,报错

[hd-mysql@localhost data]$ service mysql start

Starting MySQL. ERROR! The server quit without updating PID file (/home/hd-mysql/mysql-5.7.32/data/localhost.localdomain.pid).

二  解决办法

2.1 查看错误日志

进入到/home/hd-mysql/mysql-5.7.32/data 目录下,查看 以xxx.err结尾文件

2.查看内容

[hd-mysql@localhost data]$ more localhost.localdomain.err

2022-12-29T03:36:37.267121Z mysqld_safe Logging to '/home/hd-mysql/mysql-5.7.32/data/localhost.localdomain.err'.

2022-12-29T03:36:37.282396Z mysqld_safe Starting mysqld daemon with databases from /home/hd-mysql/mysql-5.7.32/data

2022-12-29T03:36:37.289659Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)

2022-12-29T03:36:37.289748Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)

2022-12-29T03:36:37.495033Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled

2022-12-29T03:36:37.495083Z 0 [Note] /home/hd-mysql/mysql-5.7.32/bin/mysqld (mysqld 5.7.32-log) starting as process 5222 ...

mysqld: File './master-bin.index' not found (Errcode: 13 - Permission denied)

2022-12-29T03:36:37.507912Z 0 [ERROR] Aborting

2022-12-29T03:36:37.507962Z 0 [Note] Binlog end

2022-12-29T03:36:37.508016Z 0 [Note] /home/hd-mysql/mysql-5.7.32/bin/mysqld: Shutdown complete

 可以看到权限问题:

第一行的错误提示,errcode13,一般就是权限问题,mysql用户是否对数据库目录内的所有文件具有写的权限

3.查看mysql的安装目录

可以看到data目录下,有些文件的的权限隶属于root用户!

 

 2.2  解决处理

1.切换到root用户,赋予mysql安装目录的所属hd-mysq用户的权限

chown -R hd-mysql:hd-mysql /home/hd-mysql/

 2.查看现在文件目录隶属用户,可以看到现在已经隶属于hd-mysql用户

 3.切换到hd-mysql用户,进行启动mysql

 现在问题得到解决!

以上是关于MySQL 启动日志报错:Starting MySQL. ERROR! The server quit without updating PID file的主要内容,如果未能解决你的问题,请参考以下文章

mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql

mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql

MySQL启动出现Starting MySQL.The server quit without up

Linux下启动tomcat报错RROR org.apache.catalina.core.StandardContext- Error starting static Resources java.

MySQL启动错误Starting MySQL.Manager of pid-file quit without updating file.

springboot启动报错:"Error starting ApplicationContext. To display the conditions report re-run your