- MariaDB High Performance
- Pierre MAVRO
- 561字
- 2021-08-05 18:03:17
Migrating from MySQL to MariaDB
First of all, MariaDB is a fork of MySQL. So, if you're using a version from 5.1 to 5.5, the migration will be really easy. To make it clear and simple, if you're running a MySQL version under 5.1, upgrade it first to 5.1 at least and 5.5 at max.
Then, it will be easy to migrate. First of all, you need to understand the best compatibility version, as shown in the following table:

It is recommended, for example, to switch from the 5.1 version of MySQL to the 5.1 version of MariaDB. Then test it, see if everything is fine, and then you can upgrade to a higher version of MariaDB.
There is something that you should consider: starting from the 5.6 version of MySQL, MariaDB will start to number the version from 10. Why? Because MariaDB developers want to be clear on the features portability from MySQL to MariaDB. All the features won't be ported in version 10. They may be done later or not at all. Some features will be fully rewritten for several reasons, and MariaDB developers will try to keep compatibility with MySQL. That's why for a migration, it's preferable to migrate a MySQL version from 5.1 to 5.5. If you don't use advanced features, it shouldn't be a problem as incompatibilities are very low.
Since 5.5 is really stable, you can skip the upgrade to 5.3 (the latest branch of MariaDB based on 5.1) and go straight to 5.5. Of course, complete regression testing of the application is recommended.
To get more information on the compatibility list from one version to another, I strongly recommend following the official MariaDB compatibility information page available on the main site: https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/.
Now that you've understood how to migrate, we'll perform a migration using a virtual machine. You'll need the following:
- 1 CPU
- 512 MB of RAM
- 8 GB of disk space
This is the code you need to run:
# -*- mode: ruby -*- # vi: set ft=ruby : ENV['LANG'] = 'C' # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" # Insert all your Vms with configs boxes = [ { :name => :mysqlserver }, ] $install = <<INSTALL aptitude update DEBIAN_FRONTEND=noninteractive aptitude -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install mysql-server INSTALL Vagrant::Config.run do |config| # Default box OS vm_default = proc do |boxcnf| boxcnf.vm.box = "deimosfr/debian-wheezy" end # For each VM, add a public and private card. Then install Ceph boxes.each do |opts| vm_default.call(config) config.vm.define opts[:name] do |config| config.vm.host_name = "%s.vm" % opts[:name].to_s config.vm.provision "shell", inline: $install end end end
Install on this virtual machine the application of your choice (WordPress, MediaWiki, and so on) to confirm the migration doesn't break anything.
You will see that the migration is an easy step. First of all, remove the current MySQL version, but keep the data:
apt-get remove mysql-server
Then, your database will still be available in the data directory (/var/lib/mysql
by default) but no binary will be present.
It's time to install MariaDB. First add the MariaDB repository (for version 5.5 here):
apt-get install python-software-properties apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db add-apt-repository 'deb http://mirrors.linsrv.net/mariadb/repo/5.5/debian wheezy main'
Now install MariaDB:
apt-get update apt-get install mariadb-server
It should have started without any issues. Take a look at the logs in /var/log/syslog
if this is not the case.
- R語言數(shù)據(jù)分析從入門到精通
- Android Jetpack開發(fā):原理解析與應(yīng)用實戰(zhàn)
- JavaFX Essentials
- Vue.js 3.0源碼解析(微課視頻版)
- 高級C/C++編譯技術(shù)(典藏版)
- Web程序設(shè)計(第二版)
- FFmpeg入門詳解:音視頻原理及應(yīng)用
- 表哥的Access入門:以Excel視角快速學習數(shù)據(jù)庫開發(fā)(第2版)
- Building Android UIs with Custom Views
- 移動互聯(lián)網(wǎng)軟件開發(fā)實驗指導(dǎo)
- Android Studio Cookbook
- Apache Solr PHP Integration
- INSTANT JQuery Flot Visual Data Analysis
- Kotlin進階實戰(zhàn)
- Moodle 3.x Developer's Guide