MySQL startup process

Source: Internet
Author: User

    1. Understand where/etc/init.d/mysql from, and mysql.server what relationship?

    2. The relationship between/etc/init.d/mysql and Mysqld_safe

    3. Mysqld_safe how to get MySQL started up.


    1. MySQL is a copy of Mysql.server here.

    2. MySQL boot, call Mysqld_safe

    3. Mysqld_safe calls Mysqld to start MySQL.


Extended knowledge: Mysqld_safe is a watchdog process for mysqld

Ps-axu | grep MySQL find MySQL pid

Kill-9 PID

Ps-axu | grep MySQL found another process for MySQL to be generated. You can refer to this feature of Mysqld_safe to automatically start those applications that are hung out.



MySQL boot process: Mysql.server calls Mysqld_safe,mysqld_safe call mysqld process. Normally MySQL boot fails, we need to go to Error.log to see the error. But sometimes MySQL start error, but did not write into the log, then how to do?


First Vim/etc/init.d/mysql, join Set-x.

/etc/init.d/mysql start >> start.log 2>&1. To view MySQL boot Shell--start.log.


Enable MY.CNF parameter malloc-lib=/usr/local/mysql/lib/mysql/libjemalloc.so, found that MySQL does not come up. And the Error.log log also has no error message. Flustered, how to do.

Vim/etc/init.d/mysql script, $bindir/mysqld_safe--datadir= "$datadir"--pid-file= "$mysqld _pid_file_path" $other _args >/dev/null 2>&1 & Remove the underscore section and redirect the boot log to the terminal. At this time to start will have error message, starting MySQL. 150514 06:08:59 mysqld_safe--malloc-lib '/usr/local/mysql/lib/mysql/libjemalloc.so ' can not be read and would not be used

According to the error message, modify the my.cnf file, MySQL can start normally.

This article from the "7321304" blog, reproduced please contact the author!

MySQL startup process

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.