To install MariaDB on CentOS 7, follow the steps below:
Step 1 : Begin by updating the system's package index:
Step 2 : Install MariaDB server using the following command:
Step 3 : Start the MariaDB service and enable it to start on boot:
Step 4 : Run the following command to secure your MariaDB installation:
Follow these prompts:
- Enter the root password (leave blank if not set).
- Change the root password: choose 'y'.
- Remove anonymous users: choose 'y'.
- Disallow root login remotely: choose 'y'.
- Remove test database and access to it: choose 'y'.
- Reload privilege tables now: choose 'y'.
Step 5 : Verify that MariaDB is running correctly:
Step 6 : Access the MariaDB shell with the following command:
Step 7 : Inside the MariaDB shell, you can create a new admin user and grant necessary privileges:
Congratulations! You have successfully installed MariaDB on CentOS 7.