mariadb启动报错的一个案例

来源:互联网 发布:ubuntu git 使用教程 编辑:程序博客网 时间:2024/05/16 06:16

今天安装了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换成我们的数据存储目录即可。

然后再次启动就可以了。


0 0
原创粉丝点击