Home > Database > Mysql Tutorial > body text

mysql从5.0升级到5.1

WBOY
Release: 2016-06-07 15:20:44
Original
1115 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 1、升级方式:直接将MySQL5.1.72安装目录覆盖正在运行的Mysql目录 2、备份数据库 mysqldump -uroot -A -F /data/mysql_upgrade_bak/all_databases.sql 这里可能遇到问题:mysqldump: Got error: 1556

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  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 &

mysql从5.0升级到5.1

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template