This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14096|Reply: 0

[Source] mysql 5.6.21 to view the my.cnf configuration file

[Copy link]
Posted on 9/6/2017 1:38:46 PM | | |
my.cnf is a configuration file that is loaded when mysql starts, and is usually placed in the mysql installation directory, or you can load it in other directories.
After installing mysql, there will be multiple my.cnf files in the system, some for testing.
Use the locate my.cnf command to list all my.cnf files
command
locate my.cnf
output

When we need to modify the configuration file, we need to find which my.cnf file was loaded when mysql started.
1. Check whether my.cnf of the specified directory is used
After starting mysql, we check the mysql process to see if there is a setting to use the my.cnf file of the specified directory, if so, it means that this configuration file is loaded when mysql starts.
command
ps aux|grep mysql|grep 'my.cnf'
output

You can see that /usr/local/Cellar/mysql/5.6.24/my.cnf is the configuration file for mysql startup loading.
If the above command does not output, it means that there is no setting to use my.cnf for the specified directory.
2. Check the directory where mysql reads my.cnf by default
If you do not set my.cnf to use the specified directory, mysql will read the my.cnf file in the root directory and the default directory when mysql starts.
Look at the default directory that reads the configuration file when mysql starts
command
mysql --help|grep 'my.cnf'
output

These are:mysql searches the my.cnf directory by default, with the first priority.
3. No configuration file is used at startup
If there is no setting to use the specified directory my.cnf file and the default reading directory does not have a my.cnf file, it means that the configuration file is not loaded when mysql starts, but the default configuration is used.
If you need to modify the configuration, you can create a my.cnf file (for example: /etc/my.cnf) in the directory read by default in mysql, write the configuration content to be modified, and restart mysql to take effect.





Previous:MySQL analyzes high CPU usage in high concurrency situations
Next:Google Adsense modifies the PIN code to receive the address
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com