mysql 升级手顺:
1、对应IP:x.x.x.x
对应目录:/usr/local/XXX
2、编译mysql-4.0.27
tar xvzf mysql-4.0.27.tar.gz
cd mysql-4.0.27
./configure '--prefix=/usr/local/mysql4027' '--enable-assembler' \
'--with-mysqld-user=mysql' '--without-bench' '--without-debug' \
'--with-charset=ujis' '--with-mysqld-ldflags=-all-static'
make
make install
cd /usr/local/mysql4027
chown -R root .
chgrp -R mysql .
注:此安装过程不需要建立初始化数据库表.因为这个最后用原有数据库即可!
3、停止原数据库,并把数据文件夹var移到新数据库下
/usr/local/etc/rc.d/007mysqld.sh stop
mv /usr/local/mysql/var /usr/local/mysql4027/
4、启动新数据库
/usr/local/mysql4027/bin/mysqld_safe --user=mysql &
5、连接测试
/usr/local/mysql4027/bin/mysql -A
show slave status;
show processlist;
(如果正常OK,执行第6步,如果不正常执行下面紧急恢复)
6、如果一切正常,对原有mysql进行更名,并对新数据库进行链接,这样不影响原有程序。
cd /usr/local
mv mysql mysql.060801
ln -s /usr/local/mysql4027 /usr/local/mysql
紧急恢复
如果以上操作全部失败,紧急恢复如下:
/usr/local/mysql4027/bin/mysqladmin shutdown
cd /usr/local
rm mysql
mv mysql.060801 mysql
mv /usr/local/mysql4027/var /usr/local/mysql/
/usr/local/etc/rc.d/007mysqld.sh start
阅读(730) | 评论(0) | 转发(0) |