mysql從5.0升級到5.1

來源:互聯網
上載者:User

   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 &

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.