环境
- 平安云;
- ubuntu14.04;
- 宝塔5.9;
- MySQL5.1 或者 5.5。
报错信息
181025 22:09:45 [Note] Plugin 'FEDERATED' is disabled.
/www/server/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
181025 22:09:45 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
181025 22:09:45 InnoDB: The InnoDB memory heap is disabled
181025 22:09:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
181025 22:09:45 InnoDB: Compressed tables use zlib 1.2.8
181025 22:09:45 InnoDB: Initializing buffer pool, size = 128.0M
181025 22:09:45 InnoDB: Completed initialization of buffer pool
181025 22:09:45 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 /www/server/data/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
故障原因
- 平安云的ubuntu系统权限问题,导致宝塔无法访问
/www/server/data
。 - 进而导致MySQL无法初始化。
解决方案
- 在根目录创建
mysqldata
文件夹,权限755,所有者MySQL
; - 打开MySQL控制面板→配置修改→修改所有
/www/server/data
为/mysqldata
; - 在ssh中执行初始化数据库
/www/server/mysql/scripts/mysql_install_db --user=mysql --basedir=/www/server/mysql --datadir=/mysqldata
- 执行成功后修复完成。重启一下MySQL即可打开。
备注
此教程同样适合其他云出现此错误代码。
预告
接下来要修复平安云无法运行宝塔的PHP
。