1. 安装maridb(MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可)

    yum install mariadb-server mariadb
  2. 启动maridb

    systemctl start mariadb
  3. 进入maridb(默认password为空)mysql -u root -p

    mysql -u root -p
    
    Enter password:
    
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 2
    Server version: 5.5.56-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]>
  4. 重置密码(无需重启)set password for 'root'@'localhost' =password('password');

    MariaDB [(none)]> set password for 'root'@'localhost' =password('password');
    
    Query OK, 0 rows affected (0.00 sec)

happy coding!