lower_case_table_names = 1 很有用

mysql5.X 只要配置里有了就行了

但是8不行,需要文件夹和配置里都有!否则就报错 不启动

 

但是 直接改是改不了的,需要初始化数据库的时候就加上

可ubuntu自己就初始化了数据库 那么就得先删掉自己创建的库

然后

lower_case_table_names = 1 加到my.conf里 重新初始化数据库

 

但是ubuntu20.04的apparmor又不允许用户

 /sbin/mysqld --initialize --lower-case-table-names=1  --user=mysql

那么就只能靠dpkg-reconfigure了

sudo dpkg-reconfigure mysql-server-8.0

执行这个,它会按照my.conf的配置重新初始化数据库的。。。。

 

有图有真相。。。

 

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show global variables like "%lower%";
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_file_system | OFF   |
| lower_case_table_names | 1     |
+------------------------+-------+
2 rows in set (0.00 sec)

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐