MySQL8 steps to set the correct case

After installation is complete, before initialize the database, modify my.cnf
  1. Open the mysql configuration file
    vim /etc/my.cnf

  2. At the end of the additional line
    lower_case_table_names=1
    and save it, and then initialize the database.

  3. Restart mysql,
    systemctl restart mysqld.service

If after this operation is to initialize the database, which is run after the service installed, it may be wrong.
An error similar Job for mysqld.service failed because the control process exited with error...
then you can not start the mysql service, unless open  vim /etc/my.cnfto additional lower_case_table_names=1deleted.

I find the Internet a long time, temporarily did not find a better solution, but MySQL5 do not have this problem.

Finally, my solution is as follows:

If you do not mind if data delete data

  1. Stop MySQL
    systemctl stop mysqld.service

  2. Delete MySQL data / var / lib / mysql
    rm -rf /var/lib/mysql

  3. Then again to operate in accordance with the above method.


Guess you like

Origin www.cnblogs.com/LoveShare/p/11666296.html