mycat安装

mycat 分表分库:https://www.cnblogs.com/ivictor/p/5111495.html

主从复制:http://blog.csdn.net/ziele_008/article/details/77751051

mkdir -p /home/PlatForm

cd /home/PlatForm

wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

 mv mysql-5.7.19-linux-glibc2.12-x86_64 /usr/local/mysql

 groupadd mysql

  adduser -r -g mysql mysql

chown -R mysql.mysql /usr/local/mysql

chown -R mysql /usr/local/mysql

chgrp -R mysql /usr/local/mysql

 cd /usr/local/mysql/bin

./mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --lc_messages_dir=/usr/local/mysql/share --lc_messages=en_US

#cp -a ./support-files/my-default.cnf /etc/my.cnf

 cp /usr/local/mysql/mysql.server /etc/init.d/mysql

 chmod +x /etc/init.d/mysql

 chkconfig --add mysql

 chkconfig --list mysql

vi ~/.bash_profile

export PATH=$PATH:/usr/local/mysql/bin

export PATH

source ~/.bash_profile

service mysql start

修改密码

vi /etc/my.cnf

master:

[mysqld]

server-id=1

#log-bin=log

#binlog-do-db=mstest

#replicate-do-db=test_db

#binlog-ignore-db=mysql

datadir=/usr/local/mysql/data

#socket=/usr/local/mysql/bin/mysql.sock

user=mysql

log-bin=mysql-bin

relay-log=relay-bin

relay-log-index=relay-bin-index

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

slave:

[mysqld]

server-id=2

#log-bin=log

#binlog-do-db=mstest

#replicate-do-db=test_db

#binlog-ignore-db=mysql

datadir=/usr/local/mysql/data

#socket=/var/lib/mysql/mysql.sock

user=mysql

log-bin=mysql-bin

replicate-do-db=test_db

log-slave-updates=1

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

service mysql restart

修改密码

你可能感兴趣的:(mycat安装)