The way Mysql starts (four kinds) _mysql

Source: Internet
Author: User

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!

Related Article

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.