Installing MariaDB on Ubuntu 22.04 is a straightforward process. Let's walk through the steps:
-
Update the package index to ensure you have the latest information about available packages:
bash
sudo apt update
-
Install MariaDB using the following command:
bash
sudo apt install mariadb-server
-
After installation, secure your MariaDB installation by running the security script:
bash
sudo mysql_secure_installation
-
Test your MariaDB installation by running this script:
bash
sudo systemctl status mariadb
-
If MariaDB isn’t running, you can start it with the command :
sudo systemctl start mariadb
-
Connect to the database using the mysqladmin tool:
sudo mysqladmin version
This script will guide you through several prompts to set up security options for your MariaDB installation. You'll be asked to set a root password, remove anonymous users, and disallow remote root login.
Remember to follow best practices for securing your database!
You now have MariaDB installed and secured on your Ubuntu 22.04 server.
|