A host configured to deploy multiple instances mysqld

A host mysqld instance configuration to deploy multiple configuration options Description: mysqld_multi: mysqld_multi command parameter configuration information client: The client parameter information mysqld: configuration parameters for each instance of mysql: mysql command-line tool configuration parameters mysqld_safe: Configuration parameters mysqldump mysqld start : data backup parameter myisamchk: myisamchk command configuration parameters # vim /etc/my.cnf [mysqld_multi] mysqld = / usr / local / mysql-5.5.14 / bin / mysqld_safe mysqladmin = / usr / local / mysql-5.5.14 / bin / mysqladmin user = admin password = mysqladmin log = / var / log / multi.log [client] [mysqld3306] user = mysql port = 3306 socket = /data/mydata3306/mysql.sock pid-file = / data / mydata3306 / mysql.pid datadir         = /data/mydata3306 skip-external-locking skip-name-resolve key_buffer_size = 16K max_allowed_packet = 1M table_open_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 128K server-id       = 3306 log-bin=mysql-bin-3306 log-bin-index=mysql-bin-3306.index binlog_format=row [mysqld3307] user            = mysql port            = 3307 socket          = /data/mydata3307/mysql.sock pid-file        = /data/mydata3307/mysql.pid datadir         = /data/mydata3307 tmpdir          = /data/mydata3307 skip_external_locking skip-name-resolve back_log        = 100 default-storage-engine = INNODB collation = utf8_general_ci max_connections = 800 max_connect_errors = 100000 interactive_timeout = 172800 connect_timeout = 10 max_allowed_packet = 4M max_heap_table_size = 128M tmp_table_size = 128M max_length_for_sort_data = 4096 net_buffer_length = 8K sort_buffer_size = 8M join_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 2M table_cache = 1024 thread_cache_size = 64 thread_concurrency = 8 query_cache_type = 0 query_cache_size = 64M query_cache_limit = 1M log-error = /data/mydata3307/error.log log_warnings long_query_time = 1 slow_query_log slow_query_log_file = /data/mydata3307/slow-query.log #log_slow_queries = /data/mysqldata3307/log/slow-query.log log_queries_not_using_indexes binlog_cache_size = 8M max_binlog_size = 512M log-bin = /data/mydata3307/mysql-bin-3307 log-bin-index = /data/mydata3307/mysql-bin-3307.index expire_logs_days = 3 server-id               = 3307 key_buffer_size = 32M bulk_insert_buffer_size = 16M myisam_sort_buffer_size = 64M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 myisam_recover innodb_file_per_table innodb_flush_method=O_DIRECT [mysqldump] quick max_allowed_packet = 1G [mysqld_safe] open-files-limit = 8192 [mysql] no-auto-rehash [myisamchk] key_buffer_size = 8M sort_buffer_size = 8M [mysqlhotcopy] interactive-timeout # ./scripts/mysql_install_db --datadir=/data/mydata3306 --user=mysql # ./scripts/mysql_install_db --datadir=/data/mydata3307 --user=mysql # ./bin/mysqld_multi start 3306,3307 # ./bin/mysqld_multi report 3306,3307 Reporting MySQL servers MySQL server from group: mysqld3306 is running MySQL server from group: mysqld3307 is running # mysql -uroot -P3306 -S /data/mydata3306/mysql.sock >grant shutdown on *.* to 'admin'@'localhost' identified by 'mysqladmin'; # mysql -uroot -P3307 -S /data/mydata3307/mysql.sock >grant shutdown on *.* to 'admin'@'localhost' identified by 'mysqladmin';

Reproduced in: https: //my.oschina.net/766/blog/211143

Guess you like

Origin blog.csdn.net/weixin_33755557/article/details/91546038