Install and use MariaDB database in CentOS7

1, the query MariaDB package

[root@test ~]# yum list all | grep mariadb

2, installation mariaDB

[root@test ~]# yum -y install mariadb-server

3, configuration mariaDB

[root@test ~]# systemctl start mariadb         #启动MariaDB
[Root @ test ~] # systemctl enable mariadb # MariaDB is set to boot from the start
[Root @ test ~] # netstat -ntlp # 3306 to see if the port started successfully
[Root @ test ~] # mysql_secure_installation # need to first install the configuration database

Enter current password for root (enter for none): # Enter the root password database super administrator (note not the system root password), for the first time has not yet set a password to enter directly Enter
Set root password? [Y / n] # set a password, y
New password: # New Password
Re-enter new password: # Enter the password again
Remove anonymous users? [Y / n] # remove anonymous user, y
Disallow root login remotely? [Y / n] # refused root remote login, y
Remove test database and access to it [Y / n] # delete the test database, y:? Deleted. n: Do not delete, the database will be a test database, generally do not need
Reload privilege tables now? [Y / n] # reload the privileges table, y. Or maybe restart the service

4. Login test mariaDB

[root@test ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 5.5.60-MariaDB MariaDB Server
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)]>
MariaDB [(none)]>quit


Guess you like

Origin blog.51cto.com/yudielongyou/2475017