• Mysql修改lower_case_table_names


    mysql server有个参数叫做 lower_case_table_names,控制表名、字段名的大小写
    它可以有3个值:
    0:大小写敏感
    1:比较名字时 忽略大小写,但创建表时,大写字母也转为小写字母。
    2:比较名字时 忽略大小写,创建表时,维持原样。

    查看:

    [root@bbmg-law-test-01 ~]# mysql -uroot -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 1745
    Server version: 5.7.33 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2021, Oracle and/or its affiliates.
    
    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> use mysql;
    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 variables like 'lower_case_table_names';
    +------------------------+-------+
    | Variable_name          | Value |
    +------------------------+-------+
    | lower_case_table_names | 0     |
    +------------------------+-------+
    1 row in set (0.00 sec)

    修改:

    在my.cnf配置文件中[mysqld]标签的作用区域,增加lower_case_table_names=1的配置,然后重启MySQL服务

    [root@bbmg-law-test-01 ~]# vim /etc/my.cnf

    在mysqld下 添加或修改 lower_case_table_names = 1

    [root@bbmg-law-test-01 ~]# service mysqld restart

    再次查看:

        

  • 相关阅读:
    OpenJudge 2764 数根 C++
    OpenJudge / Poj 1835 宇航员 C++
    elasticsearch系统性能调优总结
    ES基本查询总结
    Vim最全快捷键键位图
    Idea常用插件整合
    微信小程序开发资源汇总
    Java JNI调用本地动态库使用详解
    java开发调试定位分析工具大全
    Redux-saga使用教程详解
  • 原文地址:https://www.cnblogs.com/cjybarcode/p/14517413.html
Copyright © 2020-2023  润新知