Mysql is automatically started with linux. method 1: use mysql. server to create the Startup Program, which is actually called mysqld_safecp/usr/local/mysql/share/mysql. server/etc/rc. d/init. d/mysqldchkconfig -- add mysqldchkconfig -- level 2345 mysqld on www.2cto.com II. method 2: Write the Startup Program and call mysqld_safe $ vi mysqldauto #! /Bin/shMYSQLHOME =/usr/local/mysql # modify the installation directory for your mysql if [$ #-ge 1]; then mysqldProc = 'ps-ef | grep-E "mysqld. + safe "| grep-v" grep "| wc-l 'if [$1 =" stop "]; then if [$ mysqldProc-eq 1]; then $ MYSQLHOME/bin/mysqladmin-uroot shutdown fi elif [$1 = "start"]; then if [$ mysqldProc-eq 0]; then $ MYSQLHOME/bin/mysqld_safe -- user = mysql & fi fifi $ chmod + x mysqldauto $ mv mysqldauto/etc/rc. d/init. d/$ ln-s/etc/rc. d/init. d/mysqldauto/etc/rc. d/rc3.d/S99mysqld $ ln-s/etc/rc. d/init. d/mysqldauto/etc/rc. d/rc0.d/K20mysqld www.2cto.com