mariadb启动报错的一个案例

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

然后再次启动就可以了。


  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值