"MySQL" View MySQL configuration file path and related configuration

Source: Internet
Author: User

(1) About the configuration file path

Sometimes I find that although I try to modify some variables of the configuration file, it does not take effect. It turned out that the modified file was not a configuration file read by the MySQL server.

If you don't know the profile path currently used by MySQL, you can try this:

As can be seen, the server first reads the/etc/my.cnf file, and if it finds that the file does not exist, then attempts to read from a few subsequent paths in turn.

Text command:/usr/sbin/mysqld--verbose--help | Grep-a 1 ' Default options '

(2) About configuration file configuration item segmentation

Profile my.cnf are usually divided into several parts, such as [Client],[mysqld], [MySQL], and so on. A MySQL program usually reads a segmented part with the same name as the server mysqld usually reads the related configuration item under [Mysqld]. If the configuration item location is incorrect, the configuration will not take effect. Detailed documentation I think you can refer to this article: my.cnf detailed.

(3) About global variables

Also, if you want to see some of the global variable settings for MySQL, you can view this in the case of non-login and permissions: Mysqladmin variables-p,

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

"MySQL" View MySQL configuration file path and related configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.