(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.
|