centos7安装mysql 8.0.31报错Failed to find valid data directory.

报错信息如下:

根据其他博客提示,执行了以下命令:

mysqld --initialize --console

日志有新的报错:The designated data directory /var/lib/mysql/ is unusable. Y
ou can remove all files that the server added to it.

centos7安装mysql 8.0.31报错Failed to find valid data directory._第1张图片

根据提示直接删除了整个/var/lib/mysql,重启服务成功

centos7安装mysql 8.0.31报错Failed to find valid data directory._第2张图片

登录查看正常:

centos7安装mysql 8.0.31报错Failed to find valid data directory._第3张图片

你可能感兴趣的:(mysql,数据库)