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

View: 14737|Reply: 0

[Source] Linux View the MySQL configuration file path and related configurations

[Copy link]
Posted on 4/10/2019 4:44:56 PM | | | |
(1) About the profile path

Sometimes I find that although I try to modify some variables in the configuration file, it doesn't work. Later I found out that it was because the modified file was not the configuration file read by the MySQL server.

If you are not sure about the profile path currently used by MySQL, you can try looking at it like this:


Or execute:


[mysql@linuxtest ~]$ mysqld --verbose --help|grep -A 1 'Default options'
2015-12-01 17:23:56 0 [Note] mysqld (mysqld 5.6.27-75.0-log) starting as process 6858 ...
2015-12-01 17:23:56 6858 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 10005)

2015-12-01 17:23:56 6858 [Warning] Buffered warning: Changed limits: max_connections: 214 (requested 2000)

2015-12-01 17:23:56 6858 [Warning] Buffered warning: Changed limits: table_open_cache: 400 (requested 2000)

2015-12-01 17:23:56 6858 [Note] Plugin 'FEDERATED' is disabled.
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
2015-12-01 17:23:56 6858 [Note] Binlog end
2015-12-01 17:23:56 6858 [Note] Shutting down plugin 'CSV'
2015-12-01 17:23:56 6858 [Note] Shutting down plugin 'MyISAM'
[mysql@linuxtest ~]$ mysql --verbose --help|grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
As you can see from the above figure, the server will first read the /etc/my.cnf file, and if it finds that the file does not exist, it will try to read it from the following paths.



(2) Regarding the configuration item segmentation

The configuration file my.cnf is usually divided into several parts, such as [client], [mysqld], [mysql], etc. MySQL programs usually read the segment part of the same name as it, for example, the server mysqld usually reads the relevant configuration item under the [mysqld] segment. If the configuration item is not positioned correctly, the configuration will not take effect.

(3) About global variables

In addition, if you want to view some global variable settings in MySQL, you can do this when you are not logged in and have permissions: mysqladmin variables -p,

This operation is equivalent to using the show global variables command when logging in.





Previous:Use CefSharp in AnyCpu mode
Next:The latest spider pool station group version
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