Start multiple MySQL instances

Source: Internet
Author: User

Start multiple MySQL instances

In order to facilitate testing and final deployment may require a multi-mysql instance, here to record the method of operation, first initialize two MySQL data directory

mysql_install_db--user=mysql--datadir=/var/lib/mysql/3306/mysql_install_db--user=mysql--datadir=/var/lib/mysql /3307/

Then use a configuration file similar to the following, because only need to use the Blackhole Engine, most of the parameters are not much significance, set a smaller number of resources instead of saving

[mysqld_multi]mysqld  = /usr/bin/mysqld_safemysqladmin = /usr/bin/mysqladmin[ mysqld3306]port        = 3306socket       = /var/lib/mysql/3306/mysqld.sockdatadir     = /var/lib/mysql/3306key _buffer_size = 16mmax_allowed_packet = 1mtable_open_cache = 64sort_buffer_size  = 512knet_buffer_length = 8kread_buffer_size = 256kread_rnd_buffer_size =  512Kmyisam_sort_buffer_size = 8Mlog-bin=mysql-binbinlog_format=mixedserver-id    = 3306innodb_data_file_path = ibdata1:10M:autoextendinnodb_buffer_pool_size =  16minnodb_additional_mem_pool_size = 2minnodb_log_file_size = 5minnodb_log_buffer_size  = 8MINNODB_FLUSH_LOG_AT_TRX_COMMIT = 2INNODB_LOCK_WAIT_TIMEOUT = 50[MYSQLD3307] Port        = 3307socket      = /var/lib/mysql/3307/ Mysqld.sockdatadir     = /var/lib/mysql/3307key_buffer_size = 16mmax_ Allowed_packet = 1mtable_open_cache = 64sort_buffer_size = 512knet_buffer_length  = 8kread_buffer_size = 256kread_rnd_buffer_size = 512kmyisam_sort_buffer_size  = 8mlog-bin=mysql-binbinlog_format=mixedserver-id   = 3307innodb_data_file_path  = ibdata1:10m:autoextendinnodb_buffer_pool_size = 16minnodb_additional_mem_pool_size  = 2minnodb_log_file_size = 5minnodb_log_buffer_size = 8minnodb_flush_log_at_trx _commit = 2innodb_lock_wait_timeout = 50

To start a multi-instance, start the two instances as follows

Mysqld_multi start 3306mysqld_multi Start 3307


Start multiple MySQL instances

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.