Nonsense not much said, went straight to the subject.
Four ways to start MySQL:
1, Mysqld
Start MySQL server:./mysqld--defaults-file=/etc/my.cnf--user=root
Client connections:
MySQL--defaults-file=/etc/my.cnf
or
mysql-s/tmp/mysql.sock
2, Mysqld_safe
Start MySQL server:./mysqld_safe--defaults-file=/etc/my.cnf--user=root &
Client connections:
MySQL--defaults-file=/etc/my.cnf
or
mysql-s/tm/mysql.sock
3, Mysql.server
Cp-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 connections: Same 1, 2
4, Mysqld_multi
mkdir $MYSQL _base/data2 cat <<-EOF>>/etc/my.cnf [mysqld_multi] mysqld =/usr/local/mysql/bin/mysqld_safe Mysqladmin =/user/local/mysql/bin/mysqladmin user = mysqladmin Password = mysqladmin [mysqld3306] Port = 3306 Socket =/t Mp/mysql3306.sock pid-file =/tmp/mysql3306.pid skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table _open_cache = Sort_buffer_size = 512K Net_buffer_length = 8K Read_buffer_size = 256K read_rnd_buffer_size = 512K MyISAM _sort_buffer_size = 8M Basedir =/usr/local/mysql DataDir =/usr/local/mysql/data [mysqld3307] Port = 3307 Socket =/tmp/m Ysql3307.sock pid-file =/tmp/mysql3307.pid skip-external-locking key_buffer_size = 16M Max_allowed_packet = 1M table_ope N_cache = Sort_buffer_size = 512K Net_buffer_length = 8K Read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sor T_buffer_size = 8M Basedir =/usr/local/mysql DataDir =/usr/local/mysql/data2 EOF #mysql-S/tmp/mysql3306.sock mysql> GRANT SHUTDOWN on *.* to ' MysQladmin ' @ ' localhost ' identified by ' mysqladmin ' with GRANT option; #mysql-S/tmp/mysql3307.sock mysql>grant SHUTDOWN on *.* to ' mysqladmin ' @ ' localhost ' identified by ' mysqladmin ' with g Rant option;
Start MySQL server:./mysqld_multi--defaults-file=/etc/my.cnf Start 3306-3307
Shutdown MySQL server: mysqladmin shutdown
The above mentioned is a small series to introduce four kinds of MySQL to start the way, I hope to help you!