Linux下從MySQL遷移到MariaDB

來源:互聯網
上載者:User

於是我決定把我的所有伺服器從 MySQL 遷移到 MariaDB.

對 Arch 使用者來說很簡單,照著官方新聞裡面的來就是了:

 
  1. systemctl stop mysqld 
  2. pacman -S mariadb libmariadbclient mariadb-clients 
  3. systemctl start mysqld 
  4. mysql_upgrade -p 

而對於 openSUSE 就更傻瓜式了,畢竟是預設的嘛: zypper in mariadb 一句就夠。

至於 Debian/Ubuntu 使用者就要稍微複雜一些,不過整個過程還是很流暢的:

首先到 MariaDB 官方的 Repository Configuration Tool 去選一個合適的源,然後把給出來的地址放到 /etc/apt/sources.list 檔案底部:

 
  1. # MariaDB 5.5 repository list - created 2013-03-26 14:20 UTC 
  2. # http://mariadb.org/mariadb/repositories/ 
  3. deb http://mirror2.hs-esslingen.de/mariadb/repo/5.5/debian squeeze main 
  4. deb-src http://mirror2.hs-esslingen.de/mariadb/repo/5.5/debian squeeze main 

接下來執行以下命令:

 
  1. apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db 
  2. apt-get update 
  3. apt-get install mariadb-server mariadb-client 

於是 MySQL或者 Percona)就自動卸載並且替換成 MariaDB 了,在某些具體環境下,可能還需要執行這些命令:

 
  1. apt-get autoremove 
  2. apt-get upgrade # or apt-get dist-upgrade 
  3. mysql_upgrade -p 

然後就搞定了!盡情折騰吧 

編輯精選】

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

聯繫我們

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