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
请问一下有没有遇到过的佬,有没有什么解决方案?
stackoverflow.com/questions/345166...
可以试试 mysqld --initialize [with random root password]
mysqld --initialize-insecure [with blank root password]