您的位置:首页 > 数据库 > MariaDB

mariadb启动报错的一个案例

2016-06-08 10:00 507 查看
今天安装了mariadb,在启动时报错如下:

[root@iZ284mvmum4Z bin]# mysqld_safe

160608 09:18:25 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.

160608 09:18:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

160608 09:18:26 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

然后去分析报错文件,看到如下内容:

160608  9:18:26 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

160608  9:18:26 [Note] Server socket created on IP: '0.0.0.0'.

160608  9:18:26 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

160608 09:18:26 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

因为这里它报错mysql.host不存在,而且无法打开mysql.plugin表,说明此时的问题是没有安装初始的数据库,因此执行如下命令即可:

mysql_install_db --user=mysql --datadir=/usr/local/mysql/var

这里的datadir换成我们的数据存储目录即可。

然后再次启动就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: