当前位置:网站首页>linux中mysql表名区不区分大小写
linux中mysql表名区不区分大小写
2022-07-27 07:13:00 【亿速云】
linux中mysql表名区不区分大小写
这篇文章主要介绍了linux中mysql表名区不区分大小写的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇linux中mysql表名区不区分大小写文章都会有所收获,下面我们一起来看看吧。
linux中mysql表名是区分大小写的;mysql的数据库名、表名、变量名和表的别名在linux中都是严格区分大小写的,而列名与列的别名在所有的情况下都是忽略大小写的,可以修改MySQL的配置文件中的“ower_case_table_names”参数来设置是否区分大小写。
本教程操作环境:linux7.3系统、mysql8.0.22版本、Dell G3电脑。
linux中mysql表名区分大小写吗
linux中,mysql安装完成后,表名默认区分大小写,且该属性无法修改,网上说的在/etc/mysql/my.cnf中增加字段的配置都无法生效,修改后会导致mysql无法启动。
mysql在linux中表名区分大小写,mysql在Windows中表名不区分大小写;可以在MySQL的配置文件“my.ini [mysqld]”中增加一行“ower_case_table_names = 参数”来设置是否区分大小写。
MySQL在Linux下数据库名、表名、列名、别名大小写规则是这样的:
数据库名与表名是严格区分大小写的;
表的别名是严格区分大小写的;
列名与列的别名在所有的情况下均是忽略大小写的;
变量名也是严格区分大小写的;
MySQL在Windows下都不区分大小写。
所以在不同操作系统中为了能使程序和数据库都能正常运行,最好的办法是在设计的时候都转为小写,但是如果在设计的时候已经规范化大小写了,那么在Windows环境下只要对数据库的配置做下改动就行了,
具体操作如下:
在MySQL的配置文件中my.ini [mysqld]中增加一行ower_case_table_names = 1
参数解释:
0:区分大小写
1:不区分大小写
在 MySQL中,数据库和表对就于那些目录下的目录和文件。
因而,操作系统的敏感性决定数据库和表命名的大小写敏感。这就意味着数据库和表名在Windows 中是大小写不敏感的,而在大多数类型的 Unix系统中是大小写敏感的。
列名与列的别名在所有的情况下均是忽略大小写的,而表的别名又是区分大小写的。要避免这个问题,你最好在定义数据库命名规则的时候就全部采用小写字母加下划线的组合,而不使用任何的大写字母。或者也可以强制以 -O lower_case_table_names=1 参数启动
关于“linux中mysql表名区不区分大小写”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“linux中mysql表名区不区分大小写”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
边栏推荐
- Shell loop exercise
- Understanding and learning of node flow and processing flow in io
- js正则表达式实现每三位数字加一个逗号
- The token verification of applet message push configuration failed. Please check and confirm
- The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly 100 times the improvement of analysis performance
- Oracle cleans up the Database disk space of tables with referenced partitions
- Gossip: Recently, many friends talk about going abroad
- mysql备份策略
- Bingbing's learning notes: classes and objects (middle)
- sql语句批量更新 时间减去1天
猜你喜欢

Temperature and humidity measurement and display device based on Arduino

【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)

Synchronized lock

Perl: split the external command to be executed into multiple lines

正则表达式基础整理

单片机多级菜单

Bingbing's learning notes: classes and objects (middle)

Record a pit dug by yourself~

Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community

一体化实时HTAP数据库StoneDB,如何替换MySQL并实现近百倍分析性能的提升
随机推荐
「翻译」SAP变式物料的采购如何玩转?看看这篇你就明白了
flink去重(二)解决flink、flink-sql去重过程中的热点问题
漏风的小棉袄……
Clickhouse notes 1 | introduction, features | installation and use based on centos7 system | common data types | mergetree table engine | SQL operation
yhb_ sysbench
flink中维表Join几种常见方式总结
shell awk相关练习
SQLite common function integration
Essay: college entrance examination
单片机多级菜单
Examples of Oracle triggers
A priority SQL problem
Debug:与泛型有关的“无法解析的外部符号”
Use Popen to execute a command and get the return result
【QT】capture. Obj:-1: error: lnk2019: unresolved external symbols__ imp_ Htons (solution)
Pg_ relation_ Size question
Understanding and learning of properties class and properties configuration file
ARP broadcasting practice cases
Shell condition test, judgment statement and operator of shell system learning
Oracle composite query