In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "the order of MySQL reading configuration files, startup mode and startup principle introduction", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "the order of MySQL reading configuration files, startup mode and startup principle introduction"!
I. the order in which MySQL reads configuration files
Reading order: / etc/my.cnf > / etc/mysql/my.cnf > / usr/etc/my.cnf > ~ / .my.cnf
Command verification:
[root@mysql ~] # mysql-- verbose-- help | grep my.cnf
Order of preference, my.cnf, $MYSQL_TCP_PORT
/ etc/my.cnf / etc/mysql/my.cnf / usr/etc/my.cnf ~ / .my.cnf
II. MySQL startup mode
MySQL is usually started in three ways: mysqld, mysqld_safe, and mysqld_multi (mainly used for multi-instance startup)
The relationship in three ways:
First of all, when we start using service mysqld start or / etc/init.d/mysqld start, we actually use the script mysql.server, which calls mysqld_safe by default to start mysqld, so usually when we check the process after starting mysql, we will find that there are two processes, mysqld and mysqld_safe. These two methods are usually launched in a single instance, but you can also use mysqld to launch multiple instances. While mysqld_multi is used to start multiple instances, it also starts mysql by calling mysqld_safe and mysqld first.
Third, the startup principle of MySQL
The default mysql service launcher is the mysql.server,mysql.server program, which mainly uses two programs and a function, which are my_print_defaults, myslqd_safe and parse_server_arguments.
1. My_print_defaults: read the my.cnf configuration file and pass the output parameters to parse_server_arguments. The program only reads the parameters in [mysqld] in my.cnf.
2. Parse_server_arguments: this function handles the parameter assignment passed by my_print_defaults to-- basedir,-- datadir,-- pid-file,-- server-startup-timeout.
3. The myslqd_safe:mysqld_safe program calls the mysqld program to start the mysql service, and [mysqld_safe] overrides the parameters in the mysqld section.
4. Mysqld_multi will read the parameters under [mysqld_muti] and [mysqldN] in the configuration file. If N needs an integer, it is recommended to use the port number. The configuration of this part will override the configuration in the [mysqld] section.
5. When the mysqld process dies, the mysqld_safe process detects and restarts the mysqld.
At this point, I believe that everyone has a deeper understanding of the "MySQL read configuration file sequence, startup mode and startup principle introduction", might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.