MySQL 8.0.11 不区分大小写启动报错解决

问题描述:在my.cnf 内添加了如下命令行

lower_case_table_names=1 启动报错

tar xf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz

在mysql-8.0.11-linux-glibc2.12-x86_64/目录内

vim my.cnf
[mysqld]
basedir=/home/bes/mysql-8.0.11
datadir=/home/bes/mysql-8.0.11/data
socket=/home/bes/mysql-8.0.11/mysql.socket
character-set-server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
lower_case_table_names=1
[mysql]
socket=/home/bes/mysql-8.0.11/mysql.socket
[client]
port=3306
socket=/home/bes/mysql-8.0.11/mysql.sock


初始化正常
[bes@test162 mysql-8.0.11]$ ./bin/mysqld --initialize --user=bes --basedir=/home/bes/mysql-8.0.11/ --datadir=/home/bes/mysql-8.0.11/data/
2022-09-02T10:14:51.918842Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2022-09-02T10:14:51.919393Z 0 [System] [MY-013169] [Server] /home/bes/mysql-8.0.11/bin/mysqld (mysqld 8.0.11) initializing of server in progress as process 29903
2022-09-02T10:14:56.004550Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 3euCoIoyd#:/
2022-09-02T10:14:58.088418Z 0 [System] [MY-013170] [Server] /home/bes/mysql-8.0.11/bin/mysqld (mysqld 8.0.11) initializing of server has completed


启动报错如下
[bes@test162 bin]$ ./mysqld --defaults-file=../my.cnf --datadir=../data
2022-09-02T10:17:02.007042Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-09-02T10:17:02.007196Z 0 [System] [MY-010116] [Server] /home/bes/mysql-8.0.11/bin/mysqld (mysqld 8.0.11) starting as process 30019
2022-09-02T10:17:02.936801Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').
2022-09-02T10:17:02.938777Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-09-02T10:17:02.939097Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-09-02T10:17:03.769453Z 0 [System] [MY-010910] [Server] /home/bes/mysql-8.0.11/bin/mysqld: Shutdown complete (mysqld 8.0.11)  MySQL Community Server - GPL.

解决方案:

卸载现有环境,或者备份数据库

重新初始化用以下命令执行:

[bes@test162 bin]$ ./mysqld --initialize --user=bes --basedir=/home/bes/mysql-8.0.11/ --datadir=/home/bes/mysql-8.0.11/data  --lower_case_table_names=1


2022-09-02T10:33:01.134249Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2022-09-02T10:33:01.134420Z 0 [System] [MY-013169] [Server] /home/bes/mysql-8.0.11/bin/mysqld (mysqld 8.0.11) initializing of server in progress as process 30069
2022-09-02T10:33:04.768022Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: XByW_4(k*cjl
2022-09-02T10:33:06.649334Z 0 [System] [MY-013170] [Server] /home/bes/mysql-8.0.11/bin/mysqld (mysqld 8.0.11) initializing of server has completed

##回显正常,初始化完成

启动并检验

[bes@test162 bin]$ nohup ./mysqld --defaults-file=../my.cnf --datadir=../data 2>&1 >/dev/null &
[1] 30117
[bes@test162 bin]$ nohup: 忽略输入重定向错误到标准输出端

[bes@test162 bin]$ jobs
[1]+  运行中               nohup ./mysqld --defaults-file=../my.cnf --datadir=../data 2>&1 > /dev/null &

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值