Home > Database > Mysql Tutorial > Teach you how to view the MySQL configuration file path and related configurations

Teach you how to view the MySQL configuration file path and related configurations

坏嘻嘻
Release: 2018-09-15 10:32:45
Original
7029 people have browsed it

The content of this article is to teach you how to view the MySQL configuration file path and related configurations. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

(1) About the configuration file path

Sometimes, I find that although I try to modify some variables in the configuration file, it does not take effect. Later I discovered that it was because the modified file was not the configuration file read by the MySQL server.

If you don’t know the configuration file path currently used by MySQL, you can try to check it like this:

Teach you how to view the MySQL configuration file path and related configurations

As can be seen from the above figure, the server will first read the /etc/my.cnf file. If it finds that the file does not exist, it will try to read from the following paths in sequence.

(2) About configuration file 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 the segment part with the same name. For example, the server mysqld usually reads the relevant configuration items under the [mysqld] segment. If the location of the configuration item is incorrect, the configuration will not take effect. For detailed documentation, I think you can refer to this article: my.cnf detailed explanation.

(3) About global variables

In addition, if you want to view some global variable settings of MySQL, you must not log in and have permissions You can view it like this: mysqladmin variables -p,

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



The above is the detailed content of Teach you how to view the MySQL configuration file path and related configurations. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template