2.配置master 将压缩包解压: C:/software/mysql-5.6.16-winx64-3310 在这个目录下建立tmp文件夹 在该目录下新增my.ini文件,其内容如下:
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It"s a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] server-id=1 #replicate-same-server-id=0 # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = C:/software/mysql-5.6.16-winx64-3310 datadir = C:/software/mysql-5.6.16-winx64-3310/data tmpdir = C:/software/mysql-5.6.16-winx64-3310/tmp port = 3310 log-bin=master-bin log-bin-index=master-bin.index #default-character-set = utf8 # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] port = 3310 #default-character-set = utf8其中,server-id变量表示该节点在集群内的唯一表示,每个节点必须使用不同的server-id来区分 basedir,datadir,tmpdir这些表示的是数据文件或临时文件的存放路径,因为我们在一台机器上创建2个mysql
C:\software\mysql-5.6.16-winx64-3310\bin>mysqld --console 2014-03-26 22:20:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2014-03-26 22:20:48 7204 [Note] Plugin 'FEDERATED' is disabled. 2014-03-26 22:20:48 7204 [Note] InnoDB: Using atomics to ref count buffer pool pages 2014-03-26 22:20:48 7204 [Note] InnoDB: The InnoDB memory heap is disabled 2014-03-26 22:20:48 7204 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2014-03-26 22:20:48 7204 [Note] InnoDB: Compressed tables use zlib 1.2.3 2014-03-26 22:20:48 7204 [Note] InnoDB: Not using CPU crc32 instructions 2014-03-26 22:20:48 7204 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2014-03-26 22:20:48 7204 [Note] InnoDB: Completed initialization of buffer pool 2014-03-26 22:20:48 7204 [Note] InnoDB: Highest supported file format is Barracuda. 2014-03-26 22:20:48 7204 [Note] InnoDB: 128 rollback segment(s) are active. 2014-03-26 22:20:48 7204 [Note] InnoDB: Waiting for purge to start 2014-03-26 22:20:48 7204 [Note] InnoDB: 5.6.16 started; log sequence number 1625977 2014-03-26 22:20:49 7204 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: d