MySQL modifies a solution where the ES1en.cnf configuration does not take effect

  • 2021-01-02 22:00:45
  • OfStack

This article illustrates a solution where MySQL modifying the ES2en.cnf configuration does not take effect. To share for your reference, the details are as follows:

1. The question is:

How is it that the my. cnf configuration file has been modified but does not take effect?

2. The reason:

We note that it only says modify my.cnf, without specifying which file its absolute path is. That is, it is possible to modify the my.cnf file that is not on the correct path.

In MySQL, multiple ES21en. cnf profiles are allowed, some of which can have an impact on the overall system environment, for example: /etc/ my. cnf. Some can only affect individual users, for example: ~/.my.cnf.

MySQL reads each ES31en. cnf configuration file in the following order:

/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/mysql/etc/my.cnf
~/.my.cnf

my.cnf under other custom paths, for example: /data/mysql/yejr_3306/ my.cnf

Either the mysqld server-side program or the mysql client program can specify the configuration file path to read using the following two parameters:

-ES57en-ES58en =#, read only the specified file (no other configuration files are read)

-defaults-ES62en-ES63en =#, after reading the global configuration from another configuration file of higher priority, then reading the specified configuration file (some options can override the Settings from the global configuration file)

Therefore, you can see that if you modify my.cnf under the non-" famous "directory, it may not appear to be effective and you need to specify it yourself, or you can put all 1 under /etc/ my.cnf and manage it in a multi-instance way.

For more information about MySQL, please refer to: MySQL Common Error Tips and Solutions Summary, MySQL Log Operation Tips collection, MySQL Transaction Operation Tips Collection, MySQL Stored Procedure Tips Collection, MySQL Database Lock Related Tips Collection and MySQL Common Functions Summary

I hope this article has been helpful to you with the MySQL database.


Related articles: