To install MariaDB on CentOS 8, follow these steps:
1. Update the system packages:
Before installing any software, it's a good idea to update your system to ensure you have the latest packages. Open a terminal or SSH into your CentOS 8 server and run the following commands:
sudo dnf clean all
sudo dnf update
2. Install MariaDB server:
CentOS 8 uses the DNF package manager, so you can easily install MariaDB by running the following command:
sudo dnf install mariadb-server
3. Start and enable the MariaDB service:
After the installation is complete, start the MariaDB service and enable it to start on boot using the following commands:
sudo systemctl start mariadb
sudo systemctl enable mariadb
4. Secure the MariaDB installation:
By default, MariaDB is not configured with a root password, and it is recommended to set a root password for security. You can run the following command to secure your installation:
sudo mysql_secure_installation
This command will prompt you to set the root password, remove anonymous users, disallow root login remotely, and remove the test database. You can choose 'Y' or 'N' based on your preferences and requirements.
5. Verify the installation:
To check if MariaDB is running and to verify its version, you can use the following command:
sudo systemctl status mariadb
mysql --version
That's it! MariaDB is now installed and running on your CentOS 8 system. You can interact with the database using the `mysql` command-line client or other tools like phpMyAdmin if you have a web server installed.
0 comments:
Post a Comment