Home WebServer PanelaaPanel How to convert MySQL to MariaDB on DirectAdmin

How to convert MySQL to MariaDB on DirectAdmin

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

1. Overview

In this article, AZDIGI will show you how to convert MySQL to MariaDB on DirectAdmin as well as how to install the latest version of MariaDB.

For some reason, you want to use MariaDB rather than MySQL like:

  • Supports more storage engines.
  • Released after MySQL.
  • Is a true open source because currently MySQL is governed by oracle and not operated by the community.
  • MariaDB is maintained by the creators of MySQL.
  • Fully compatible with MySQL.
  • More cool features.

2. Technical comparison between MariaDB and MySQL

MariaDBMySQL
DevelopersMariaDB Corporation AB (MariaDB Enterprise) and
MariaDB Foundation (community MariaDB Server)
Oracle
Released for the first time20091995
Current release10.3.10, October 20188.0.12, July 2018
LicenseOpen sourceOpen source + proprietary
DevelopOpenClose
Storage ToolsInnoDB
MyISAM
BLACKHOLE
CSV
MEMORY
ARCHIVE
MERGE
ColumnStore
MyRocks
Aria
SphinxSE
TokuDB
CONNECT
SEQUENCE
Spider
Cassandra
InnoDB
MyISAM
BLACKHOLE
CSV
MEMORY
ARCHIVE
MERGE
SQL ManagementHeidiSQLMySQL Workbench
Deployment languageC and C++C and C++
Server OSFreeBSD
Linux
Solaris
Windows
FreeBSD
Linux
OS X
Solaris
Windows
APIProprietary native API
ADO.NET
JDBC
ODBC
Proprietary native API
ADO.NET
JDBC
ODBC
Supported programming languagesAda
C
C#
C++
D
Eiffel
Erlang
Go
Haskell
Java
JavaScript (Node.js)
Objective-C
OCaml
Perl
PHP
Python
Ruby
Scheme
Tcl
Ada
C
C#
C++
D
Delphi
Eiffel
Erlang
Haskell
Java
JavaScript (Node.js)
Objective-C
OCaml
Perl
PHP
Python
Ruby
Scheme
Tcl
CustomerBooking.com, Wikipedia, Google, Canal+, ClubMed, Deutsche Telekom, La Poste, Virgin…NASA, US Navy, Spotify, Netflix, Nokia, Joomla, Uber, PHP-Nuke, Tesla, Fujitsu…
MarketDefault MariaDB in LAMPDefault MySQL in AppServ

3. Instructions to switch MySQL to MariaDB on DirectAdmin

To convert MySQL to MariaDB on DirectAdmin, we need to do the following 3 steps.

Step 1: SSH into your DirectAdmin system

To convert MySQL to MariaDB on DirectAdmin, we need to SSH or access your VPS/server with root privileges first. If you do not know how to SSH into your VPS or Server, you can refer to the following tutorial:

After successfully SSHing, we continue with step 2 to start the process of converting MySQL to MariaDB on DirectAdmin.

Step 2: Check the current version of MySQL in use

The check also ensures that we are using MySQL only because many cases have been running MariaDB without you knowing. To check the current version of Mysql, we use the following command:

AZDIGI Tutorial
mysqld -V
    

The image below is my result, with the currently installed version of 5.6.48.

covert Mysql to MariaDB on DirectAdmin

Now that you have checked the current version of MySQL in use, we continue with step 3 to covert MySQL to MariaDB on DirectAdmin.

NOTE: Risks cannot be ignored and data safety is still the most important, so before upgrading to MariaDB, you need to back up your entire database.

Step 3: Convert MySQL to MariaDB on DirectAdminin with CustomBuild 2.0

First, we need to check if the version of CustomBuild we are using is 2.0 or not. To check the version of CustomBuild you are using, please check out the following short tutorial:

In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:

After you have upgraded to CustomBuild 2.0, run the following commands to upgrade MySQL on DirectAdmin:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build set mariadb 10.5
./build set mysql_inst mariadb
./build set mysql_backup yes
./build update
./build mariadb
    

Explanation of the above commands:

  • Command 1: Move to custombuild folder.
  • Command 2: Adjust the configuration of the MariaDB version to the latest version of 10.5, you can follow the newer versions at the MariaDB homepage.
  • Command 3: Use the database management system is MariaDB (there are 2 options 1 is Mysql, 2 is MariaDB).
  • Command 4: Adjust the configuration to enable database backup before running the installation command.
  • Command 5: Update custombuild script.
  • Command 6: Start the conversion from Mysql to MariaDB.

More information: at the moment I write this article, there is only 10.5 MariaDB version 10.5, so when you change it to 10.6 it will not be valid, but in the future, it may be valid after MariaDB releases this version. Below is a picture of when I tried to adjust the version to 10.6.

covert Mysql to MariaDB on DirectAdmin
Version 10.6 is not valid with MariaDB’s install option.

The installation time will depend on the strength of your VPS/Server and the connection at that time because, in this process, it is necessary to download some quite heavy installation files. The installation process on my VPS 4 CPU Cores is 4 minutes.

Another small note that affects your installation time is that during the installation process, the system will automatically dump all existing databases into a directory to avoid data loss or errors. Therefore, if your VPS/Server has a lot of databases, the installation time will be longer.

To check where the directory containing the database is dumped, use the following 2 commands:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
cat options.conf | grep mysql_backup_dir
    

Here my directory will be /usr/local/directadmin/custombuild/mysql_backups.

cat options.conf | grep mysql_backup_dir

After the installation is complete, the screen will show as below:

Screen Shot 2020 07 22 at 9.29.07 PM

Although MariaDB is different from MySQL, when we use it, we also use the same mysqld command. Similar to the MySQL version check command, we also use the mysqld -V command to see if we have received the latest MariaDB version.

Screen Shot 2020 07 22 at 9.30.09 PM

So my VPS has the latest MariaDB version 10.5.4 installed.

Summary

hrough this article, you have learned how to quickly convert Mysql to MariaDB on DirectAdmin as well as the directory containing the databases that were dumped during the installation of the new MariaDB. Hope this article will be of great help to you.

Wishing you success.

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign