MySQL参数之lower_case_table_names

发布时间:2020-07-13 22:29:44 作者:鲸鱼新
来源:网络 阅读:1254

lower_case_table_names 参数MySQL 库表 大小写,默认为0
0 库表敏感,区分大小写,指定的大小写保存文件
1 库表不敏感,不区分大小写,文件系统以小写保存
2 使用Create语句指定的大小写保存文件,但MySQL会将之转化为小写,启动的时候日志报警告
MySQL参数之lower_case_table_names

参数从0调为1
lower_case_table_names =0下操作库表都敏感


mysql> create  database wx;
Query OK, 1 row affected (0.01 sec)

mysql> create  database WX;
Query OK, 1 row affected (0.00 sec)

mysql> use wx;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> create table wx(id int);
Query OK, 0 rows affected (0.01 sec)

mysql> create table WX(id int);
Query OK, 0 rows affected (0.01 sec)

调整参数lower_case_table_names =1
此时:两表都有表信息,现在虽然有两库,但是在一库中建立表,另一库中也会出现表

mysql> use wx;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------+
| Tables_in_wx |
+--------------+
| WX           |
| wx           |
+--------------+
2 rows in set (0.00 sec)

mysql> use WX;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------+
| Tables_in_wx |
+--------------+
| WX           |
| wx           |
+--------------+
2 rows in set (0.00 sec)

参数lower_case_table_names =1下操作

mysql> create database ww;
Query OK, 1 row affected (0.01 sec)

mysql> create database WW;
ERROR 1007 (HY000): Can't create database 'ww'; database exists
mysql> use ww;
Database changed
mysql> create table ww(id  int);
Query OK, 0 rows affected (0.01 sec)

mysql> create table WW(id  int);
ERROR 1050 (42S01): Table 'ww' already exists

参数从0调到1,变化数据文件仅仅存放在小写的库中

[root@wxtest WX]# ls
db.opt
[root@wxtest wx]# ls
db.opt  t1.frm  t1.ibd  wx.frm  WX.frm  wx.ibd  WX.ibd
推荐阅读:
  1. lower_case_table_names=0 没毛病
  2. lower_case_table_names

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

大小写 敏感 lower_case_table_nam

上一篇:磁盘的分区格式化以及LVM管理

下一篇:GitHub使用教程——(1)使用GitHub创建简历展示页

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》