• ADADADADAD

    MySQL参数之lower_case_table_names[ mysql数据库 ]

    mysql数据库 时间:2024-12-25 09:57:17

    作者:文/会员上传

    简介:

    lower_case_table_names 参数MySQL 库表 大小写,默认为00 库表敏感,区分大小写,指定的大小写保存文件1库表不敏感,不区分大小写,文件系统以小写保存2使用Create语句指定的大小写

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

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

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

    mysql> createdatabase wx;Query OK, 1 row affected (0.01 sec)mysql> createdatabase WX;Query OK, 1 row affected (0.00 sec)mysql> use wx;Database changedmysql> 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 namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> 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 namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> 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 existsmysql> use ww;Database changedmysql> create table ww(idint);Query OK, 0 rows affected (0.01 sec)mysql> create table WW(idint);ERROR 1050 (42S01): Table 'ww' already exists

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

    [root@wxtest WX]# lsdb.opt[root@wxtest wx]# lsdb.optt1.frmt1.ibdwx.frmWX.frmwx.ibdWX.ibd
    MySQL参数之lower_case_table_names.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载