set sql_mode = NO_ENGINE_SUBSTITUTION;
#Guideline MySQL
###Install gmake
tar zxvf cmake-VERSION.tar.gz
cd cmake-VERSION
./bootstrap
gmake
gmake install
###Required:
rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
###Install mysql
groupadd mysql
useradd -r -g mysql mysql
passwd mysql
tar zxvf mysql-VERSION.tar.gz
cd mysql-VERSION
cmake .
make -j4
make install
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql:mysql /var/lib/mysql/
bin/mysqld_safe --user=mysql &
bin/mysql_secure_installation
cp support-files/mysql.server /etc/init.d/mysql.server
chkconfig mysql.server on
#Cau hinh /etc/my.cnf (luu y cau hinh server-id, auto_increment_increment, auto_increment_offset
#Restart lai ung dung
#Grant quyen tuong ung
GRANT SELECT, INSERT, DELETE, UPDATE ON <database name>.* TO '<user>'@'<ip>' IDENTIFIED BY 'ke-34#$klZ' WITH GRANT OPTION;
GRANT SELECT, INSERT, DELETE, UPDATE, EVENT, EXECUTE ON <database name>.* TO '<user>'@'<ip>' IDENTIFIED BY 'wurfl-383#$k5Z' WITH GRANT OPTION;
#Cau hinh replication
GRANT REPLICATION SLAVE ON *.* TO 'replication'@'<ip>' IDENTIFIED BY '<password>';
CHANGE MASTER TO MASTER_HOST='<ip>', MASTER_USER='<user>', MASTER_PASSWORD='<user>', MASTER_PORT=3306,MASTER_LOG_FILE='pe-mysql3-bin.000001', MASTER_LOG_POS=120, MASTER_CONNECT_RETRY=10;
CHANGE MASTER TO MASTER_HOST='<ip>', MASTER_USER='<user>', MASTER_PASSWORD='slave', MASTER_PORT=3306,MASTER_LOG_FILE='pe-mysql5-bin.000001', MASTER_LOG_POS=120, MASTER_CONNECT_RETRY=10;
CHANGE MASTER TO MASTER_HOST='<ip>', MASTER_USER='<user>', MASTER_PASSWORD='slave', MASTER_PORT=3306,MASTER_LOG_FILE='pe-mysql6-bin.000001', MASTER_LOG_POS=120, MASTER_CONNECT_RETRY=10;
Không có nhận xét nào:
Đăng nhận xét