1、同上篇,先映射本地磁盘到虚拟机
本地创建MysqL目录
MysqL56目录结构:
[MysqLd] pid-file = /var/run/MysqLd/MysqLd.pid socket = /var/run/MysqLd/MysqLd.sock datadir = /var/lib/MysqL symbolic-links=0 character-set-server = utf8 #skip-networking innodb_print_all_deadlocks = 1 max_connections = 2000 max_connect_errors = 6000 open_files_limit = 65535 table_open_cache = 128 max_allowed_packet = 4M binlog_cache_size = 1M max_heap_table_size = 8M tmp_table_size = 16M read_buffer_size = 2M read_rnd_buffer_size = 8M sort_buffer_size = 8M join_buffer_size = 28M key_buffer_size = 4M thread_cache_size = 8 query_cache_type = 1 query_cache_size = 8M query_cache_limit = 2M ft_min_word_len = 4 log-bin = MysqL-bin server-id = 1 binlog_format = mixed performance_schema = 0 explicit_defaults_for_timestamp #lower_case_table_names = 1 interactive_timeout = 28800 wait_timeout = 28800 # Recommended in standard MysqL setup sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES [MysqLdump] quick max_allowed_packet = 16M [myisamchk] key_buffer_size = 8M sort_buffer_size = 8M read_buffer = 4M write_buffer = 4M
2、
docker pull MysqL:5.6
3、
docker run -p 3306:3306 --name MysqL56 -v /e/docker/MysqL56/conf:/etc/MysqL/conf.d -v /e/docker/MysqL56/logs:/logs -v /e/docker/MysqL56/data:/var/lib/MysqL -e MysqL_ROOT_PASSWORD=123456 -d MysqL:5.6 --innodb-flush-method=O_DSYNC --innodb-use-native-aio=0
注意:红色字体 在windows挂载虚拟盘的时候必须设置,否则会报