公告:魔扣目录网为广大站长提供免费收录网站服务,提交前请做好本站友链:【 网站目录:https://www.morko.net 】, 免友链快审服务(50元/站),

点击这里在线咨询客服
新站提交
  • 网站:51998
  • 待审:31
  • 小程序:12
  • 文章:1030137
  • 会员:747

在centos8系统上安装MySQL,使用的是centos7上安装MySQL的脚本,出现了以下问题,以做记录:

问题一:日志文件不存在,MySQL无法启动

错误日志:

[root@confluence packages]# /etc/init.d/mysqld restart ERROR! MySQL server PID file could not be found! Starting MySQL.2022-01-15T03:58:44.753030Z mysqld_safe error: log-error set to '/var/log/mariadb/mariadb_error.log', however file don't exists. Create writable for user 'mysql'. ERROR! The server quit without updating PID file (/home/confluence/mysql/mysql_data/confluence.pid). 1.2.3.4.

原因和解决方法:

根据日志提示,MySQL无法启动是因为指定的日志文件/var/log/mariadb/mariadb_error.log不存在
touch创建/var/log/mariadb/mariadb_error.log,并修改权限为mysql:mysql,该错误解决。

问题二:/etc/my.cnf文件为空,MySQL无法启动

错误日志:

[root@confluence packages]# /etc/init.d/mysqld start Starting MySQL.. ERROR! The server quit without updating PID file (/home/confluence/mysql/mysql_data/confluence.pid). [root@confluence packages]#

1.2.3.

原因和解决方法:

原因是/etc/my.cnf文件是空的,什么配置都没有。
查看/etc/my.cnf,文件没有配置数据目录等信息,文件内容如下:

[root@confluence mysql]# cat /etc/my.cnf # # This group is read both both by the client and the server # use it for options that affect everything # [client-server] # # include all files from the config directory # !includedir /etc/my.cnf.d[root@confluence mysql]# 1.2.3.4.5.6.7.8.9.10.11.12.13. /etc/my.cnf.d目录下只存在client.cnf一个文件,内容也是空的: [root@confluence mysql]# cat /etc/my.cnf.d/client.cnf # # These two groups are read by the client library # Use it for options that affect all clients, but not the server # [client] # This group is not read by mysql client library, # If you use the same .cnf file for MySQL and MariaDB, # use it for MariaDB-only client options [client-mariadb][root@confluence mysql]# 1.2.3.4.5.6.7.8.9.10.11.12.

把/etc/my.cnf文件补充完整,问题即解决。

问题三:/etc/my.cnf文件权限过大导致MySQL无法启动

错误日志:

[root@confluence etc]# /etc/init.d/mysqld start my_print_defaults: [Warning] World-writable config file '/etc/my.cnf' is ignored. Starting MySQL.my_print_defaults: [Warning] World-writable config file '/etc/my.cnf' is ignored. my_print_defaults: [Warning] World-writable config file '/etc/my.cnf' is ignored. .. ERROR! The server quit without updating PID file (/home/confluence/mysql/mysql_data/confluence.pid). [root@confluence etc]#

原因和解决方法:

原因是因为/etc/my.cnf文件是从其它节点拷贝拷贝过来的,上传后默认的权限过大。把/etc/my.cnf文件的权限改成644,重新启动MySQL则成功。

 

原文来自:https://blog.51cto.com/u_10950710/4977853
本文地址:https://www.linuxprobe.com/centos-mysql-yy.html编辑:王华超,审核员:逄增宝
Linux命令大全:https://www.linuxcool.com/
Linux系统大全:https://www.linuxdown.com/
红帽认证RHCE考试心得:https://www.rhce.NET/

分享到:
标签:MySQL
用户无头像

网友整理

注册时间:

网站:5 个   小程序:0 个  文章:12 篇

  • 51998

    网站

  • 12

    小程序

  • 1030137

    文章

  • 747

    会员

赶快注册账号,推广您的网站吧!
最新入驻小程序

数独大挑战2018-06-03

数独一种数学游戏,玩家需要根据9

答题星2018-06-03

您可以通过答题星轻松地创建试卷

全阶人生考试2018-06-03

各种考试题,题库,初中,高中,大学四六

运动步数有氧达人2018-06-03

记录运动步数,积累氧气值。还可偷

每日养生app2018-06-03

每日养生,天天健康

体育训练成绩评定2018-06-03

通用课目体育训练成绩评定