首先安装mysql,然后复制mysql下所有的文件及data到另一个目录下,最后修改配置,参考下面流程配置:
1、主库my.ini:
[client]
port=3306
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=310
query_cache_size=198M
table_cache=620
tmp_table_size=172M
thread_cache_size=15
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=172M
key_buffer_size=31M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=24M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=12M
innodb_buffer_pool_size=1140M
innodb_log_file_size=228M
innodb_thread_concurrency=42
log_bin_trust_function_creators=1
group_concat_max_len = -1
#add by arwen in 20200519
port=3306
max_allowed_packet=400M
basedir="