dnmp安装mysql报错问题

dnmp默认有两个版本,一个是5.7,一个是8.0,安装5.7的时候提示:

Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

initialize specified but the data directory has files in it. Aborting.

查询了相关的文章:
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist解决办法
initialize specified but the data directory has files in it. Aborting 错误解决

总结一下就是把data的文件夹都清空再启动就好了,可是依然无用。

删除mysql5的镜像和容器,用mysql8的,然后提示:


2022-11-27 19:17:08 2022-11-27T11:17:08.757120Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2022-11-27 19:17:08 2022-11-27T11:17:08.757186Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2022-11-27 19:17:08 2022-11-27T11:17:08.757539Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2022-11-27 19:17:08 2022-11-27T11:17:08.757595Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2022-11-27 19:17:08 2022-11-27T11:17:08.757936Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-11-27 19:17:10 2022-11-27T11:17:10.410103Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28)  MySQL Community Server - GPL.

按照github上的:
ocker win10专业版 mysql8.0.28 报错!

--------解决方法(只是win)--------
在docker-compose.yml mysql 加上 command: --socket=/tmp/mysql.sock

请问一下有没有遇到过的佬,有没有什么解决方案?

《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 2

stackoverflow.com/questions/345166...

可以试试 mysqld --initialize [with random root password]

mysqld --initialize-insecure [with blank root password]

1年前 评论
她来听我的演唱会 (楼主) 1年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!