Mysql is not case-sensitive by default. If the field is encoded in "*_bin", it will make mysql case-sensitive. Mysql under Linux defaults to case-sensitive table names, but in Table names under Windows are not case-sensitive.
The operating system of this tutorial: Windows 10 system, mysql version 8.0, Dell G3 computer.
1. Is MySQL case-sensitive by default? Use show Variables like '%table_names' to view the value of lower_case_table_names. 0 means distinction, 1 means no distinction.
#2. Mysql is not case-sensitive by default for varchar data, but if the field is encoded with "*_bin", mysql will be case-sensitive.
utf8_general_ci --not case sensitive
utf8_bin --case sensitive
3. Under Linux By default, MYSQL is case-sensitive in table names, but under Windows, table names are not case-sensitive.
The method to make MYSQL not case-sensitive in table names is actually very simple:
1. Log in with ROOT and modify /etc/my.cnf
2. Add a line under [mysqld]: lower_case_table_names=1
3. Restart the database That’s it
The above is the detailed content of Is mysql case sensitive?. For more information, please follow other related articles on the PHP Chinese website!