Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view the configuration file path of mysql on Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report