four ways to start MySQL:1, mysqld start MySQL server:./mysqld--defaults-file=/etc/my.cnf--user=root Client connection: MySQL--defaults-file=/etc/My.cnformysql-s/tmp/Mysql.sock2, mysqld_safe start MySQL server:./mysqld_safe--defaults-file=/etc/my.cnf--user=root &Client connection: MySQL--defaults-file=/etc/My.cnformysql-s/tm/Mysql.sock3, MYSQL.SERVERCP-v/usr/local/mysql/support-files/mysql.server/etc/init.d/Chkconfig--add mysql.server start MySQL server: Service mysql.server {start|stop|restart|reload|force-reload|Status} Client connection: Same as 1,24, Mysqld_multimkdir $MYSQL _base/Data2cat<<-EOF>>/etc/My.cnf[mysqld_multi]mysqld=/usr/local/mysql/bin/Mysqld_safemysqladmin=/user/local/mysql/bin/Mysqladminuser=Mysqladminpassword=Mysqladmin[mysqld3306]port=3306Socket=/tmp/Mysql3306.sockpid-file =/tmp/Mysql3306.pidskip-external-lockingkey_buffer_size=16mmax_allowed_packet=1mtable_open_cache= -sort_buffer_size=512knet_buffer_length=8kread_buffer_size=256kread_rnd_buffer_size=512kmyisam_sort_buffer_size=8Mbasedir=/usr/local/Mysqldatadir=/usr/local/mysql/Data[mysqld3307]port=3307Socket=/tmp/Mysql3307.sockpid-file =/tmp/Mysql3307.pidskip-external-lockingkey_buffer_size=16mmax_allowed_packet=1mtable_open_cache= -sort_buffer_size=512knet_buffer_length=8kread_buffer_size=256kread_rnd_buffer_size=512kmyisam_sort_buffer_size=8Mbasedir=/usr/local/Mysqldatadir=/usr/local/mysql/Data2eof#mysql-s/tmp/Mysql3306.sockmysql>grant SHUTDOWN on * * to'mysqladmin'@'localhost'Identified by'mysqladmin'with grant option; #mysql-s/tmp/Mysql3307.sockmysql>grant SHUTDOWN on * * to'mysqladmin'@'localhost'Identified by'mysqladmin'with grant option; start MySQL server:./mysqld_multi--defaults-file=/etc/my.cnf Start3306-3307shut down MySQL server: Mysqladmin shutdown can refer to<>http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#server-side-scripts
Four ways to start MySQL