[[Email protected] ~] #cd/opt/source/
[[Email protected] ~] #tar-zxf mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
[[Email protected] ~] #ln-S/OPT/SOURCE/MYSQL-5.6.37-LINUX-GLIBC2.12-X86_64/USR/LOCAL/MHA
[[Email protected] ~] #mkdir-P/data/mysql_33051/{data,logs,run,tmp}
[[Email protected] ~] #vi/data/mysql_33051/my.cnf
[[Email protected] ~] #chown-R mysql.mysql/data/mysql_33051/
[Email protected] ~]#/usr/local/mha/scripts/mysql_install_db--defaults-file=/data/mysql_33051/my.cnf--basedir=/ Usr/local/mha--datadir=/data/mysql_33051/data--user=mysql #初始化实例, the default location of the MY.CNF is not used, the first position is specified when initializing, otherwise it will not be recognized
[Email protected] ~]#/usr/local/mha/bin/mysqld_safe--defaults-file=/data/mysql_33051/my.cnf--user=mysql & # Launch instance
[[Email protected] ~] #ps-ef |grep MySQL
Root 8964 6737 1 15:57 pts/0 00:00:00/bin/sh/usr/local/mha/bin/mysqld_safe--defaults-file=/data/mysql_33051/my.cnf-- User=mysql
MySQL 10435 8964 15:57 pts/0 00:00:04/usr/local/mha/bin/mysqld--defaults-file=/data/mysql_33051/my.cnf--basedir=/ Usr/local/mysql--datadir=/data/mysql_33051/data--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql--log-error =/data/mysql_33051/logs/mysqlerror.log--open-files-limit=65535--pid-file=/data/mysql_33051/run/mysqld.pid-- Socket=/data/mysql_33051/run/mysql.sock--port=33051
MySQL5.6 MHA of MySQL high-availability architecture