mysql startup

 MYSQL boot process goes through the following sequence

Sequentially reads the configuration file 1.mysql

Reading order

/etc/my.cnf>/etc/mysql/my.cnf>/usr/etc/my.cnf ~/.my.cnf

2.MYSQL startup mode

Start MYSQL three ways: mysqld, mysqld_safe, mysqld_multi (mainly for starting multiple instances)

First, when using MYSQL.SERVER script we use the service mysqld start using this script mysqld_safe to start mysqld by default, so usually we'll see after starting MYSQL exist (mysqld process and mysql_safe of) this process is to start two way single instance . mysqld_multi used to start the multi-instance, it is to start by calling MYSQLD_SAFE MYSQL and MYSQLD.

3.mysql start principle

MYSQL default service startup program is MYSQL.server, mysql.server program will be used primarily a function of the two programs and, procedures for the MYSQLD_SAFE and MY_PRINT_DEFAULTS, function PARSE_SERVER_ARGUMENTS

(1) my_print_defaults: reading my.cnf configuration file, the parameters passed to the output parse_server_arguments, the program in the read-only parameter my.cnf [mysqld] in.

(2) parse_server_arguments: my_print_defaults process parameters of the function assigned to the transfer from the --basedir, - datadir, - pid-file, - server-startup-timeout

(3) myslqd_safe: mysqld_safe mysqld program calls program to start mysql service, [mysqld_safe] overrides the parameter mysqld section

(4) mysqld_multi reads the configuration file [mysqld_muti], [mysqldN] The following parameters, an integer N when needed, was recommended that port numbers, this portion will be arranged to cover the [mysqld] section arranged

(5) When mysqld process hang, mysqld_safe process will be monitored and re-mysqld will start up.

 

Guess you like

Origin www.cnblogs.com/flamechan1981/p/11572706.html