Solution: 1. Copy the "my-medium.cnf" file in the "/usr/share/mysql" directory to the "/etc" directory; 2. Rename the copied file to "my .cnf" is enough. The reason why "my.cnf" cannot be found is that MySQL installed using the rpm package will not install the "/etc/my.cnf" file.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
When I want to set mysql to be case-insensitive, I find that the /etc/my.cnf configuration file cannot be found.
1. Solution: Just copy the my-medium.cnf file in the /usr/share/mysql directory to the /etc directory,
2. Rename the copied file to "my.cnf"
The reason is:
Use rpm package The installed MySQL will not install the /etc/my.cnf file.
As for why MySQL can start normally without this file, there are two opinions:
First In other words, my.cnf is just a parameter file when MySQL is started. It does not need to be used. In this case, MySQL will start with the built-in default parameters.
The second statement is that MySQL automatically uses the my-medium.cnf file in the /usr/share/mysql directory when it starts. This statement is limited to MySQL installed in the rpm package.
Extended knowledge
Installing MySQL through rpm will not install the /etc/my.cnf file, so when configuring master-slave replication, I don’t know how to configure it
When specifically starting mysql, this file is just one of its built-in startup parameters
Even if you can't find it and want to configure this file, you can search it in the file path and make a copy. Specifically in /usr/share/mysql/my-medium.cnf
, also through cp /usr/share/mysql/my-medium.cnf /etc/my. cnf
If you don’t even have this file, you can search directly in the root directory
Recommended learning: Linux video tutorial
The above is the detailed content of What should I do if Linux cannot find my.cnf?. For more information, please follow other related articles on the PHP Chinese website!