Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (6.1k points)
Are the table names in the MySQL are case sensitive?

On my Windows development machine, the code I have is able to query my tables which seem to be all lowercase. When I am deploying to the test server in our datacenter the table names seem to start with an uppercase letter.

The servers we use are all on Ubuntu OS.

1 Answer

0 votes
by (12.7k points)
edited by

The database and the table names aren't case sensitive in the Windows Operating System and are case sensitive in most variations of Unix.

In MySQL, the databases correspond to the directories inside the data directory. Every table within the database corresponds to at least one of the file inside the database directory. Hence, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and the table names.

You can set how the names of the tables are stored on the disk using the system variable lower_case_table_names (in the my.cnf configuration file under [mysqld]).

Go through the section: Identifier Case Sensitivity for more information.

Want to be learn SQL? You should enroll in Intellipaat's SQL Certification program.

Related questions

Browse Categories