The following describes the installation of MariaDB 10.4 on Ubuntu 18.04 system, and also applies to Ubuntu 16.04 system. We can install MariaDB 10.4 on Ubuntu from the APT repository. MariaDB is a direct replacement for MySQL with more features, a new storage engine and better performance. At the time of this writing, MariaDB 10.4 is available in Beta. If you want to use the official version, use MariaDB 10.3.
Related Links
MariaDB website
Download MariaDB
Specific steps to install MariaDB 10.4 on Ubuntu 18.04
To install MariaDB on Ubuntu 18.04, you need to add the MariaDB repository to your system.
Step1. install software-properties-common. If it is missing, install it:
sudo apt-get install software-properties-common
Step2. import the MariaDB gpg key:
Run the following command to add the Repository Key to the system:
sudo apt-key adv --recv-keys --keyserver hkp: //keyserver.ubuntu.com: 80 0xF1656F24C74CD1D8
Step 3.Add apt repository
After importing the PGP key, continue to add the repository URL:
sudo add-apt-repository "deb [arch = amd64, arm64, ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $ (lsb_release -cs) main"
If there is no add-apt-repository in your system, please install it. Refer to the method of installing add-apt-repository on Ubuntu 18.04 / 16.04 / Debian 9.
Step 4.Install MariaDB Server on Ubuntu 18.04
1. The last step is to install MariaDB Server:
sudo apt update
sudo apt -y install mariadb-server mariadb-client
2. The system will prompt for the MariaDB root password. Enter the password to be set:
3. Confirm the password:
Press <OK> to confirm the new password and install MariaDB, make sure to remember or retain the password provided on the password manager.
4. The service should be started automatically after installation:
$ sudo systemctl status mysql
* mariadb.service-MariaDB 10.4.1 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
`-Migrated-from-my.cnf-settings.conf
Active: active (running) since Tue 2018-12-25 08:26:18 PST; 24min ago
Docs: man: mysqld (8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 7564 (mysqld)
Status: "Taking your SQL requests now ..."
Tasks: 32 (limit: 1110)
CGroup: /system.slice/mariadb.service
`-7564 / usr / sbin / mysqld
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: Running 'mysqlcheck' with connection arguments: --port = '3306' --socket = '/ var / run / mysqld / mysqld
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: # Connecting to localhost ...
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: # Disconnecting from localhost ...
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: Processing databases
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: information_schema
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: performance_schema
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7604]: OK
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7706]: Checking for insecure root accounts.
Dec 25 08:26:23 ubuntu-01 / etc / mysql / debian-start [7710]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
5. Test login to MariaDB shell using mysql command:
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with; or \ g.
Your MariaDB connection id is 47
Server version: 10.4.1-MariaDB-1: 10.4.1 + maria ~ bionic-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\ h' for help. Type '\ c' to clear the current input statement.
MariaDB [(none)]>
6. Use the following command to check the version:
The resulting version number is MariaDB-1: 10.4.1. At this point, you can use MariaDB 10.4 on Ubuntu 18.04.