Home  >  Article  >  Database  >  教你如何在windows与linux系统中设置MySQL数据库名、表名大小写敏感_MySQL

教你如何在windows与linux系统中设置MySQL数据库名、表名大小写敏感_MySQL

WBOY
WBOYOriginal
2016-06-01 13:05:55830browse

在 MySQL 中,数据库和表其实就是数据目录下的目录和文。

因而,操作系统的敏感性决定数据库和表命名的大小写敏感。这就意味着数据库和表名在 Windows 中是大小写不敏感的,而在大多数类型的 Unix/Linux 系统中是大小写敏感的。

MySQL大小写敏感可以通过配置文件的lower_case_table_names参数来控制。

WINDOWS:

编辑MySQL安装目录下的my.ini 文件,在[mysqld]节下 添加 lower_case_table_names=0 (备注:为0时大小写敏感,为1时大小写不敏感,默认为1),可以实现MySql按照建表Sql语句的大小写状态来定义表名。

LINUX:

编辑/etc/my.cnf文件,在[mysqld]节下 添加 lower_case_table_names 参数,并设置相应的值 (备注:为0时大小写敏感,为1时大小写不敏感,默认为0)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn