Docker 中 MySql 启动失败,报错 Can't open and lock privilege tables: Table storage engine for 'user'

  我在docker容器中安装了Mysql,能运行,当我将它commit为新镜像后,运行新容器MySql无法运行。查看日志报错为:

Can't open and lock privilege tables: Table storage engine for 'user'

  将datadir路径下的文件清空,然后执行如下命令:mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

  然后重启:service mysql start  

  MySql启动成功。

 

posted @ 2018-09-12 21:33  雨落洛  阅读(1735)  评论(0编辑  收藏  举报