Mysql – linux thesql case insensitive lower_case_table_names=1 make server cannot be started

linuxMySQLUbuntu

I use mysql in linux ubuntu an I want to set lower_case_table_names = 1 in /etc/mysql/my.cnf file. But after I inserted the variable, the mysql server cannot be started.

o

Is there any way to set lower_case_table_names in my.cnf file or an other way to set it?

I have done this before, but it was in centos and mysql server was manual started.

Thank you.

Best Answer

  1. Config installation by download file mysql-apt-config_0.8.14-1_all.deb from mysql website (option, if you want to install mysql 8).
  2. Install mysql sudo apt-get install mysql-server.
  3. Open file my.cnf in /etc/mysql, use sudo nano /etc/mysql/my.cnf.
  4. Insert the lower_case_table_names = 1, like bellow:

    [mysqld] lower_case_table_names = 1

  5. Save file my.cnf.

  6. Backup the folder /etc/mysql, like sudo cp -r /etc/mysql /etc/mysql.bak
  7. Remove mysql installation use sudo apt-get remove -y mysql-* and sudo apt-get purge -y mysql-*.
  8. copy back the folder /etc/mysql.bak, like sudo cp-r /etc/mysql.bak /etc/mysql.
  9. back to step 1 and 2. In step 2, the installation will ask, if you keep the config file in folder /etc/mysql or use default from installation. So, I use the config file from previous installation (N).
  10. Finish installation
  11. check file my.cnf. It should be the file with lower_case_table_names = 1, like step 4.

After installation, mysql will read lower_case_table_names = 1.

Hopefully this can help.