tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
mkdir /usr/local/mysql
./configure \
--prefix=/usr/local/mysql \
--without-debug \
--enable-thread-safe-client \
--enable-assembler \
--enable-profiling \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-charset=latin1 \
--with-extra-charsets=all \
--with-big-tables \
--enable-largefile \
cp support-files/my-medium.cnf /etc/my.cnf
./mysql_install_db --user=mysql
./mysqld_safe --user=mysql &
cp /root/mysql-5.0.22/support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
sleep 3
mysql -uroot mysql -e "delete from user where user = '';"
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000014 | 386037 | | |
+------------------+----------+--------------+------------------+
记录以上数值,然后通过dump,或者tar -zcvf 备份 数据库或者var目录。
tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
mkdir /usr/local/mysql
./configure \
--prefix=/usr/local/mysql \
--without-debug \
--enable-thread-safe-client \
--enable-assembler \
--enable-profiling \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-charset=latin1 \
--with-extra-charsets=all \
--with-big-tables \
--enable-largefile \
cp support-files/my-medium.cnf /etc/my.cnf
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = shutdown
password = shutdown
log = /usr/local/mysql/etc/mysqld_multi.log
socket = /tmp/mysql.sock1
port = 3306
pid-file = /usr/local/mysql/var1/localhost.pid
datadir = /usr/local/mysql/var1
user = mysql
server-id = 2
socket = /tmp/mysql.sock2
port = 3307
pid-file = /usr/local/mysql/var2/localhost.pid
datadir = /usr/local/mysql/var2
user = mysql
server-id = 2
然后
tcp 0 0 0.0.0.0:3307 0.0.0.0:* LISTEN 23733/mysqld
通过
Slave_SQL_Running: Yes \\负责执行IO传输过来的binlog。
检查以上两项是否为yes,如果是就OK了。
















