CentOS 8 Detailed Tutorial for Installing MariaDB

  • 2021-08-17 01:46:24
  • OfStack

MariaDB database management system is a branch of MySQL, which is mainly maintained by the open source community and licensed by GPL. One of the reasons for developing this branch is that after Oracle acquired MySQL, there was a potential risk of closing the source of MySQL, so the community adopted the branch method to avoid this risk. MariaDB is fully compatible with mysql, and the usage method is also 1.

System environment:

CentOS Linux release 8.1.1911 (Core)

1) Install mariaDB

2) Start the service. After the installation is completed, first start the MariaDB service and set it to boot


systemctl start mariadb #  Start the service 
systemctl enable mariadb #  Set to boot self-starting service 

3) Initial configuration.


mysql_secure_installation

Enter current password for root (enter for none): #  Enter database super administrator root Password of ( Note that it's not the system root Password of ) , No. 1 Enter directly if the password has not been set for the second entry 

Set root password? [Y/n] #  Set the password, y

New password: #  New password 
Re-enter new password: #  Enter the password again 

Remove anonymous users? [Y/n] #  Remove anonymous users,  y

Disallow root login remotely? [Y/n] #  Reject root Remote login, n , regardless y/n Will refuse root Remote login 

Remove test database and access to it? [Y/n] #  Delete test Database, y : Delete. n Do not delete, the database will have 1 A test Database, 1 I don't need it 

Reload privilege tables now? [Y/n] #  Reload the permission table, y . Or restart the service, maybe 

4) Test whether you can log in successfully.


mysql -u root -p

5) Set the MariaDB character set to utf-8

. . . . . .

6) Remote linking to the mariadb database

Turn on remote access permissions


grant all on *.* to user03@'%' identified by '123456' with grant option

Force refresh permissions


flush privileges;

Related articles: