Install MySQL (mariadb) under Linux

1. Installation

yum -y install MariaDB-server

2. Start

systemctl start mariadb #Start service
systemctl enable mariadb #Set boot up
systemctl restart mariadb #restart
systemctl stop mariadb.service #停止MariaDB

3. Login

Use the mysql -uroot command to log in to MariaDB. At this time, the password of the root account is empty.

4. Change the password

mysql_secure_installation

5. Forgot password

5.1. Modify MySQL login settings: 
# vi /etc/my.cnf 
Add a sentence to the [mysqld] section: skip-grant-tables 

5.3 Change password

mysql_secure_installation

5.4 After the modification is successful, remove the sentence you just added, and then restart mariadb

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325561044&siteId=291194637