By default, table names are case sensitive in Windows, but you can make it case sensitive by updating the lower_case_table_names variable to 2.
ref: https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html
However, before going to the further process, create backups of your existing databases. Then you need to remove all existing databases to avoid table name inconsistency.
We were on the step to set lower_case_table_names to 2, but this variable is read-only, so you can not update it using the script. So need to change it to the configure file (my.ini). For windows, it's available in the C:\ProgramData\MySQL\MySQL Server X.X directory. Open this file in administrator mode and set the lower_case_table_names variable value to 2.
These changes will not take effect until you restart the MySQL server before restarting the MySQL Server by following steps.
- Open the Run window by using the Windows+R keyboard
- Type services.msc and press Enter
- Select the MySQL service and click the restart button
ref: https://www.mysqltutorial.org/mysql-adminsitration/restart-mysql/
MySQL server might not start because of changes in the my.ini file. In that case, we can not proceed further. Therefore lower_case_table_names variable value set back 1 again. then restart the MySQL server mentioned above.
Finally, we only have one remaining option to make a case-sensitive table name for MySQL in windows, completely removing MySQL from your machine and configuring it during installation. During install, check Advanced and Logging Options from the Type and Networking tab, then select the radio button to preserve the given case from the Advanced Options tab.
ref: Can't set lower_case_table_names in MySQL 8.x on Windows 10