This article mainly introduces how to modify MySQL. the cnf configuration does not take effect. it analyzes the execution sequence and principle of the configuration file and proposes a solution. if you need it, refer to the following example to describe how to modify MySQL. the cnf configuration does not take effect. We will share this with you for your reference. The details are as follows:
I. problems:
After modifying the my. cnf configuration file, it does not take effect. why?
II. reasons:
We noticed that I only modified my. cnf and did not know which file the absolute path is. That is to say, the my. cnf file in the correct path may be modified.
In MySQL, multiple my. cnf configuration files are allowed, and some may affect the entire system environment, such as/etc/my. cnf. Some can only affect individual users, for example :~ /. My. cnf.
The order in which MySQL reads my. cnf configuration files is as follows:
/Etc/my. cnf
/Etc/mysql/my. cnf
/Usr/local/mysql/etc/my. cnf
~ /. My. cnf
My. cnf in other custom paths, such as/data/mysql/yejr_3306/my. cnf
You can use the following two parameters to specify the path of the configuration file to be read from the line, whether it is the mysqld server or mysql client:
-Defaults-file = #, read only the specified file (no other configuration files are read)
-Defaults-extra-file = #, after reading the global configuration from other configuration files with higher priority, then read the specified configuration file (some options can overwrite the set value of the global configuration slave)
Therefore, we can see that if you modify my. cnf, which may not seem effective, must be specified by yourself, or stored in/etc/my. under cnf, you can manage multiple instances.