从 MySQL 迁移到 Mariadb

/

MySQL 被 Oracle 接管后,越来越多的用户转向了 Mariadb,很少有人能接受一个闭源的、失去社区活力的 MySQL。以下是我在 Debian 7 “Wheezy” 上将 MySQL 迁移到 Mariadb 的过程。

#  add MariaDB to system
sudo apt-get install python-software-properties
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian wheezy main'
sudo apt-get update
#  remove mysql and mariadb fully (optional)
sudo apt-get remove mysql* mariadb*
sudo apt-get autoremove
sudo rm -rf /var/lib/mysql /var/lib/dpkg/info/mysql* /var/lib/dpkg/info/mariadb*
#  reverts mysql libs that were bumped debian side to the older mariadb ones
sudo apt-get install libmysqlclient18=5.5.37+maria-1~wheezy mysql-common=5.5.37+maria-1~wheezy
sudo apt-get install mariadb-server

为了避免与 Dotdeb 等其它仓库冲突,可以将 Mariadb 的源设置为高优先级。

$ cat /etc/apt/preferences.d/MariaDB.pref
Package: *
Pin: origin ftp.osuosl.org
Pin-Priority: 1000

via:https://blog.mariadb.org/dotdeb-repository-problems-with-mariadb-5-5-solution/

Comments