MySQL從 5.1.26-rc 升級 到 5.5.15

來源:互聯網
上載者:User

今天做了MySQL升級,從 5.1.26-rc 升級 到 5.5.15,都是從官網下載的源碼包進行編譯的,其中MySQL 5.5.15是由我的同事提供的。

由於現有資料庫採用innodb的引擎,故採用mysqldump匯出備份,然後再匯入備份的方式進行升級。

升級大致步驟準備:
1、對現有資料庫做備份
2、對現有的MySQL程式重新命名(防止升級失敗還能恢複)
3、對現有許可權庫做單獨備份
4、替換現有MySQL程式
5、啟動MySQL 5.5.15,匯入備份
註:特別注意mysql日誌提示

在升級後啟動MySQL 5.5.15的過程中遇到很多提示錯誤,根據錯誤提示加以修改,很快解決問題。

a、我所安裝升級的MySQL 5.5.15,編譯目錄選擇的是/usr/local/mysql,但是我們線上的資料庫程式所在目錄為/usr/local/mysql5,我按照線上的進行升級,也將程式按照線上服務部署,故在啟動的過程中提示如下錯誤:
120717 11:19:41 mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

解決方案:將程式目錄更改為/usr/local/mysql

b、設定檔中有[mysqld]選項段有如下選項--log-slow-queries,這個選項屬於老版本的選項,根據mysql記錄檔GY_ZGC_97.err錯誤提示加以修改:
120717 11:21:32 mysqld_safe Starting mysqld daemon with databases from /home/mysql/data
120717 11:21:32 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
120717 11:21:32 InnoDB: The InnoDB memory heap is disabled
120717 11:21:32 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
120717 11:21:32 InnoDB: Compressed tables use zlib 1.2.3
120717 11:21:33 InnoDB: Initializing buffer pool, size = 1000.0M
120717 11:21:33 InnoDB: Completed initialization of buffer pool

解決方案:將設定檔中的log-slow-queries替換為slow-query-log

c、mysql啟動有個選項--datadir,該選項指定的目錄沒有許可權問題:
120717 11:21:33  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
120717 11:21:33 mysqld_safe mysqld from pid file /home/mysql/data/GY_ZGC_97.pid ended

解決方案:將mysql資料目錄屬主更改為mysql使用者:chown -R mysql.mysql data

d、mysql設定檔有如下選項:default-character-set=utf8
120717 11:22:46 InnoDB: 1.1.8 started; log sequence number 0
120717 11:22:46 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'default-character-set=utf8'
120717 11:22:46 [ERROR] Aborting

120717 11:22:46  InnoDB: Starting shutdown...
120717 11:22:47  InnoDB: Shutdown completed; log sequence number 1595675
120717 11:22:47 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

120717 11:22:47 mysqld_safe mysqld from pid file /home/mysql/data/GY_ZGC_97.pid ended

解決方案:注釋掉該選項

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.