140321 13:19:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
140321 13:19:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140321 13:19:31 InnoDB: Initializing buffer pool, size = 8.0M
140321 13:19:31 InnoDB: Completed initialization of buffer pool
140321 13:19:31 InnoDB: Started; log sequence number 0 44233
140321 13:19:31 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
140321 13:19:31 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
140321 13:19:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
mysql 的数据库存放目录默认是 /var/lib/mysql,这个目录也被定义为 mysql 的根目录,/usr/bin/mysqld_safe 负责启动进程,/usr/libexec/mysqld 执行文件负责连接 mysql,它要读取 /var/lib/mysql/mysql/plugin.frm 文件,这里显示找不到这个文件,但是我进入那个目录看过,plugin.frm 文件是实际存在的。
各种尝试之后,我终于想到了,mysqld 进程(不是/usr/libexec/mysqld)所属的用户和组都是 mysql,那么/var/lib/mysql/mysql/ 目录内的文件也应该属于 mysql 用户和 mysql 组。修改一下
chown mysql:mysql *
果然好了
140321 13:24:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140321 13:24:43 InnoDB: Initializing buffer pool, size = 8.0M
140321 13:24:43 InnoDB: Completed initialization of buffer pool
140321 13:24:43 InnoDB: Started; log sequence number 0 44233
140321 13:24:43 [Note] Event Scheduler: Loaded 0 events
140321 13:24:43 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
原文地址https://my.oschina.net/JerryBaby/blog/210288