Rate This Document
Findability
Accuracy
Completeness
Readability

Installing MariaDB

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following command to install MariaDB:
    yum install mariadb* -y
  3. Run the following commands to modify the Makefile file:
    1. Open my.cnf.
      vim /etc/my.cnf
    2. Press i to enter the insert mode and modify the file as follows:

      Before the modification:

      [mysqld]

      After the modification:

      [mysqld]
      skip-grant-tables
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Run the following command to start the database:
    systemctl start mariadb.service
  5. Run the following command to access the database:
    mysql -u root
  6. Run the following command to access MySQL:
    use mysql;
  7. Run the following commands to modify the plugin attribute:
    update user set authentication_string=PASSWORD(''), plugin='mysql_native_password' where user='root';
    flush privileges;
  8. Run the following commands to create a user with the read-only permission and a user with all permissions:
    MariaDB [(none)]> grant select on *.* to 'test'@'%' identified by '123456';
    MariaDB [(none)]> grant all on *.* to 'pasa'@'%' identified by '123456';
    MariaDB [(none)]> flush privileges;
  9. After the creation is complete, enter exit.
  10. Run the following commands to check whether the users are successfully created:
    mysql -upasa -p123456

    The users are successfully installed if the following information is displayed: