Mysql master slave yum uninstall selinux yum remove selinux *-y involved in the software license mysql-5.1.40.tar.gz put the above software package under/software/mysql Unzip a unzip, install mysqltar zxvf mysql-5.1.40.tar.gzcd. /configure -- prefix =/usr/local/mysql -- with-extra-charsets = all -- with-plugins = all if error: No curses/termcap library foundyum is prompted: yum list | grep ncursesyum-y install ncurs Es-develyum install ncurses-devel makemake install add mysql user and group groupadd mysqluseradd-g mysql copy mysql configuration file my. cnf cp support-files/my-medium.cnf/etc/my. cnf initializes the database/usr/local/mysql/bin/mysql_install_db -- user = mysql. The following steps are performed to put data files in/data/(early data disks are separately attached to this directory.) directory to facilitate migration. You can choose ******************** mkdir/data/mysqldatacp-au/usr/local/mysql/var /* /data/mysqldatarm-rf/usr/local/mysql/var/cd/usr/local/mysql/ln-s/data/mysqldata varchown-R mysql/data/mysqldata/chgrp -R mysql/data/mysqldata/********************** Add the environment variable vi/etc/profile PATH = $ PATH: /usr/local/mysql/bin/source/etc/profile close start mysqladmin-uroot-p shutdown/usr/local/mysql/bin/mysqld_safe -- user = mysql & ** It is best to install centos4.8 in the environment and the rpm package, which is consistent with the public network to avoid unnecessary troubles. If you want to change the version, you need to test ** grant select, INSERT, UPDATE, DELETE, CREATE, drop on bankaccount. * TO custom @ localhost identified by 'topid'; GRANT all privileges ON *. * TO root @ '2017. 16.4.44 'identified BY '123456'; adjust mysql> use mysql to delete an empty password account for anonymous connection to the local machine mysql> delete from user where user = ""; change the root Password mysql> update user set password = Password ('newpassword') where User = 'root'; mysql> flus H privileges; Authorize the new user mysql> grant all privileges on DB. * to user @ '2017. 22.5.% 'identified by '20140901'; Remove User revoke all on *. * from dba @ localhost; two master-SLAVE configurations ensure that the master database and SLAVE database server-id cannot be the same 1) master database mysql> grant replication slave on *. * TO repl @ '2017. 22.5.% 'identified BY '000000'; mysql> flush tables with read LOCKdump a copy of the Database SQL file, after completion. Mysql> show master status; + bytes + ----------- + -------------- + bytes + | File | Position | Binlog_Do_DB | bytes | + bytes + ----------- + -------------- + bytes + | mysql-bin.000001 | 106 | + bytes + ------------- + -------------- + ---------------- + record the status file mysql> unlock tables; 2) copy the SQL file from the database TO the slave database, and sourcemysql> CHANGE MASTER TO MASTER_HOST = '2017. 22.5.22 ', MASTER_USER = 'repl', MASTER_PASSWORD = '000000', MASTER_LOG_FILE = 'mysql-bin.000001', MASTER_LOG_POS = 123456; mysql> start slave; mysql> show slave status; ------------------------------------------------------------------ seven involves other associations 1. kernel Parameter Optimization 2. iptables firewall policy (Open Port 80 and other ports) 3. use iptables to avoid tracking connections and solve the Connection Tracing problem (the link tracing table is full, so a new connection cannot be created. use the iptables-connlimit module to control the number of concurrent connections (to prevent the use of tools to brush web pages, etc.) 4. lvs backend realserver Configuration