Get the App
SLTechnology News&Howtos  ›  Development  › 

How to view the configuration file path of mysql on Linux

Shulou Source: shulou.com Published: 2022-06-02 00:50:09 09月19日 Update

This article mainly introduces how to view the configuration file path of mysql on Linux related knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you will have something to gain after reading this article on how to view the configuration file path of mysql on Linux, let's take a look.

(1) about the configuration file path

Sometimes, I find that although I try to change some variables in the configuration file, it doesn't work. It turned out later that the modified file was not a configuration file read by the MySQL server.

If you are not clear about the configuration file path currently used by MySQL, you can try to view it like this:

Mysqld-- verbose-- help | grep-A 1 'Default options' copy code

Or execute:

Mysql-- verbose-- help | grep-A 1 'Default options' copy code

[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: 2000 (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 figure above, the server first reads the / etc/my.cnf file, and if it doesn't exist, it tries to read it from the next few paths in turn.

(2) about profile configuration item segmentation

The configuration file my.cnf is usually divided into several parts, such as [client], [mysqld], [mysql], and so on. MySQL programs usually read fragments with the same name, for example, the server mysqld usually reads the relevant configuration items under the [mysqld] segment. If the configuration item is not located correctly, the configuration will not take effect.

(3) about global variables

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

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

This is the end of the article on "how to view the configuration file path of mysql on Linux". Thank you for reading! I believe that everyone has a certain understanding of "how to view the profile path of mysql on Linux". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Configuration file path variable server knowledge attempt service code global content article part login clear picture above value location command often Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Huawei Shulou Technology Shulou Tech Info Apple