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