Understand where/etc/init.d/mysql from, and mysql.server what relationship?
The relationship between/etc/init.d/mysql and Mysqld_safe
Mysqld_safe how to get MySQL started up.
MySQL is a copy of Mysql.server here.
MySQL boot, call Mysqld_safe
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