從MySQL 5.1升級到MariaDB 5.5.x

來源:互聯網
上載者:User

不過對於使用 MySQL 己久, 並且很熟悉 MySQL 生態的我們, 其實換 MySQL 並不是這麼迫切的事情, 畢竟還沒有到末日嘛.

不過該來的還是會來, 之前 Gentoo portage 出現 MySQL 5.5 升級的選項, 我一升級上去, MySQL 5.5 就動不了, 原因不明, 我也懶得查, 所以我暫時設 mask 暫時用舊版.

該來的還是會來, 最近的 Portage 似乎就有強迫要使用 5.5 的傾向了, Getoo MySQL 5.5 有提供 MySQL 和MariaDB 的選項.

目前來看, 比起 MySQL, MariaDB 是比較好的選擇[2]. 至少應該不用怕 Oracle 砍掉這個 Product, 畢竟 Oracle 的主力是 Oracle 的 DB. 不是 MySQL.

查了一下, Gentoo 論壇[3]內似乎沒有關於升級到 MariaDB 的災情出現, 所以我也就有點放心的準備升級了. (常用 Gentoo 的就知道, 有時沒有這麼順利的事情呀)

不過隨手升了一下, 還真的很簡單, 以下是步驟

(1) Stop MySQL

 
  1. $ /etc/init.d/mysql stop 

(2) 移除 /etc/portage/package.mask 有關 virtual/mysql-5.5 那一行

(3) 安裝 MariaDB

 
  1. $ emerge -aV MariaDB 

(4) 升級 configure file.

 
  1. $ etc-update 

(5) 升級 MySQL DB

 
  1. $ mysql_upgrade –password= 

(6) 更新系統的 MySQL Library , 這是最難的, 不過會用 Gentoo 的就要自己解了

$ revdep-rebuild

目前看起來還算正常, 希望不要出什麼大問題才好.

[1] Oracle Makes More Moves To Kill Open Source MySQL

[2] MariaDB versus MySQL – Features

[3] MySQL –> MariaDB howto?

編輯精選】

  1. MariaDB 5.3將支援ALTER TABLE的進度提示
  2. MySQL創始人打造MariaDB 全面相容MySQL 5.1
  3. MariaDB 2周年了
  4. 教你五步最佳化你的MongoDB
  5. NoSQL在企業中的發展曆程

相關文章

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.