码迷,mamicode.com
首页 > 数据库 > 详细

mysql问题排查

时间:2016-10-26 11:30:07      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:mysql

系统删除了mysql用户,导致mysql重启报错,内容如下:

161025 21:24:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

/usr/libexec/mysqld: Can‘t find file: ‘./mysql/plugin.frm‘ (errno: 13)

161025 21:24:55 [ERROR] Can‘t open the mysql.plugin table. Please run mysql_upgrade to create it.

161025 21:24:55  InnoDB: Initializing buffer pool, size = 8.0M

161025 21:24:55  InnoDB: Completed initialization of buffer pool

161025 21:24:55  InnoDB: Operating system error number 13 in a file operation.

InnoDB: The error means mysqld does not have the access rights to

InnoDB: the directory.

InnoDB: File name ./ibdata1

InnoDB: File operation call: ‘open‘.

InnoDB: Cannot continue operation.

161025 21:24:55 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


考虑到mysql服务使用mysql用户启动的,首先增加mysql用户,useradd -r mysql

修改目录权限:cd /var/lib/mysql

              chown -R mysql.mysql *

启动还是报错,显示信息:

161025 21:57:47 [ERROR] /usr/libexec/mysqld: Can‘t create/write to file ‘/var/run/mysqld/mysqld.pid‘ (Errcode: 13)

161025 21:57:47 [ERROR] Can‘t start server: can‘t create PID file: Permission denied

这个很明显了,mysql.pid没有权限生成

赋予权限:chown -R mysql.mysql /var/run/mysqld/

启动mysql,成功。

本文出自 “Linux技术交流” 博客,请务必保留此出处http://9678130.blog.51cto.com/9668130/1865708

mysql问题排查

标签:mysql

原文地址:http://9678130.blog.51cto.com/9668130/1865708

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!