http://blog.csdn.net/zqtsx/article/details/9378703 更全
cmake ../ \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql3306 \-DMYSQL_DATADIR=/usr/local/mysql3306/data -DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1
./mysql_install_db --user=mysql --basedir=/usr/local/mysql3306 --datadir=/usr/local/mysql3306/data
./mysqld_safe \
--defaults-file=/usr/local/mysql3306/my.cnf
./mysqld_safe \
--defaults-file=/usr/local/mysql3406/my.cnf
/usr/local/mysql3406/bin/mysqladmin -u root -h 127.0.0.1 -P3406 password '123456'
/usr/local/mysql3406/bin/mysql -h 127.0.0.1 -u root -p
GRANT REPLICATION SLAVE ON *.* TO 'backup'@'127.0.0.1' IDENTIFIED BY '123456';
change master to master_host='127.0.0.1', master_user='backup', master_password='123456', master_port=3306;