Home >Database >Mysql Tutorial >mysql从5.0升级到5.1_MySQL

mysql从5.0升级到5.1_MySQL

WBOY
WBOYOriginal
2016-06-01 13:18:101128browse

bitsCN.com

1、升级方式:直接将MySQL5.1.72安装目录覆盖正在运行的Mysql目录
2、备份数据库 mysqldump -uroot -A -F > /data/mysql_upgrade_bak/all_databases.sql
这里可能遇到问题:mysqldump: Got error: 1556: You can’t use locks with log tables. when using LOCK TABLES
解决办法:
# which mysqldump
/usr/bin/mysqldump
修改/etc/profile
export PATH=$PATH:$MYSQL_BASE/bin―->export PATH=$MYSQL_BASE/bin:$PATH(将$MYSQL_BASE/bin移到$PATH前面)

注:-F 即flush logs,可以重新生成新的日志文件,当然包括log-bin日志
3、备份安装目录
tar -zcvf mysql5.0.92_bak.tar.gz /usr/local/mysql
4、备份数据目录
tar -zcvf mysql5.0.92_data.tar.gz /data/mysql_data/mysql
5、备份配置文件
cp /etc/my.cnf ./
6、关闭mysql
mysqladmin shutdown
7、升级(解压替换)
tar -zxvf mysql-5.1.73-linux-x86_64-glibc23.tar.gz
rm /usr/local/mysql/*
mv mysql-5.1.73-linux-x86_64-glibc23/* /usr/local/mysql/*
8、重启
mysqld_safe &

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn