第一步:尝试修改文件my.ini,发现改了重启不管用:
C:\Program Files\MySQL\MySQL Server 8.0\bin>notepad my.ini
[mysqld] lower_case_table_names=2
第二步:尝试初始化mysql服务,带上参数。注意,会清空数据库,所以
务必先备份数据!!!
参考:
https://blog.csdn.net/cccgo68/article/details/132295123
C:\Program Files\MySQL\MySQL Server 8.0\bin>net stop mysql80
MySQL80 服务正在停止.
MySQL80 服务已成功停止。
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --remove mysql80
Service successfully removed.
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --initialize --lower_case_table_names=2 --console
2024-05-27T03:26:20.836341Z 0 [System] [MY-013169] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.37) initializing of server in progress as process 18188
2024-05-27T03:26:20.877791Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-27T03:26:22.162748Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-27T03:26:27.121702Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: BObXz9,gYDF;
上面红字是root的临时密码。
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --install mysql80
Service successfully installed.
C:\Program Files\MySQL\MySQL Server 8.0\bin>net start mysql80
mysql80 服务正在启动 ..
mysql80 服务已经启动成功。
捎带记录一下,oceanbase兼容mysql并不能完全兼容,sql脚本需要替换一下:
1、utf8mb4_0900_ai_ci 换成 utf8_general_ci
2、utf8mb4 换成 utf8
标签:case,8.0,lower,windows,Server,Files,Program,MySQL,bin From: https://www.cnblogs.com/HaiHong/p/18215196