Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install MariaDB 10 on Debian and Ubuntu

Shulou Source: shulou.com Published: 2022-06-01 06:28:30 11月15日 Update

Editor to share with you how to install MariaDB 10 on Debian and Ubuntu, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

MariaDB is a free and open source branch of the popular database management server software MySQL. It was developed by the original developers of MySQL under GPLv2 (General Public license version 2) and remains open source.

It is designed to achieve high MySQL compatibility. For beginners, you can read MariaDB vs MySQL to learn more about their features. More importantly, it is used by large companies / organizations, such as Wikipedia, WordPress.com, and Google plus, and many more.

In this article, I will show you how to install MariaDB 10.1 stable release in Debian and Ubuntu distributions.

Install MariaDB on Debian and Ubuntu

1. Before installing MariaDB, you need to import the warehouse key and obtain the MariaDB repository with the following command

On Debian 10 (Sid)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 $sudo add-apt-repository 'deb [arch=amd64,i386] http://www.ftp.saix.net/DB/mariadb/repo/10.1/debian sid main'

On Debian 9 (Stretch)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 $sudo add-apt-repository 'deb [arch=amd64] http://www.ftp.saix.net/DB/mariadb/repo/10.1/debian stretch main'

On Debian 8 (Jessie)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db $sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://www.ftp.saix.net/DB/mariadb/repo/10.1/debian jessie main'

On Debian 7 (Wheezy)

$sudo apt-get install python-software-properties $sudo apt-key adv-- recv-keys-- keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db $sudo add-apt-repository 'deb [arch=amd64,i386] http://www.ftp.saix.net/DB/mariadb/repo/10.1/debian wheezy main'

On Ubuntu 16.10 (Yakkety Yak)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 $sudo add-apt-repository 'deb [arch=amd64,i386] http://www.ftp.saix.net/DB/mariadb/repo/10.1/ubuntu yakkety main'

On Ubuntu 16.04 (Xenial Xerus)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 $sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://www.ftp.saix.net/DB/mariadb/repo/10.1/ubuntu xenial main'

On Ubuntu 14.04 (Trusty)

$sudo apt-get install software-properties-common $sudo apt-key adv-- recv-keys-- keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db $sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://www.ftp.saix.net/DB/mariadb/repo/10.1/ubuntu trusty main'

2. Then, update the system installation package list and install the MariaDB server as follows:

$sudo apt-get update $sudo apt-get install mariadb-server

During installation, you will be asked to configure the MariaDB server; set a secure root password on the following page:

Set a new Root password for MariaDB

Enter the password again and press enter to continue the installation.

Enter the MariaDB password again

When the MariaDB installation package is installed, start the database server daemon and enable it so that it starts automatically the next time you boot:

-On SystemD Systems-$sudo systemctl start mariadb $sudo systemctl enable mariadb $sudo systemctl status mariadb-On SysVinit Systems-$sudo service mysql start $chkconfig-- level 35 mysql on OR $update-rc.d mysql defaults $sudo service mysql status

Enable the MariaDB service

Then, run the mysql_secure_installation script to protect the database, where you can:

Set the root password (if you haven't set it in the configuration section above).

Disable remote root login

Remove test database

Remove anonymous users

Overload permission configuration

$sudo mysql_secure_installation

Secure MariaDB installation

5. Once the database server is protected, you can use the following shell command to view the installed version and log in to MariaDB:

$mysql-V $mysql-u root-p

The above is all the contents of the article "how to install MariaDB 10 on Debian and Ubuntu". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Service password data database server article face more protection configuration warehouse content again command user development login input important security Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Technology Docker Shulou Tech Info