To install MariaDB on Debian 12, follow these steps:
1. Update Package Index
Start by updating the package index to ensure your system has the latest information on available packages.
2. Install MariaDB Server
Use the following command to install the MariaDB server and client:
3. Start and Enable MariaDB Service
Once installed, start the MariaDB service and enable it to start on boot.
4. Secure the Installation
To improve the security of your MariaDB server, run the security script:
During this process, you’ll be asked to:
- Set a root password.
- Remove anonymous users.
- Disallow root login remotely.
- Remove test databases.
- Reload privilege tables.
Answer each prompt based on your preferences for security.
5. Test the Installation
To verify that MariaDB is installed and running, log in to the MariaDB shell:
You should see the MariaDB shell if the installation was successful.
6. (Optional) Configure MariaDB
You can edit the MariaDB configuration file for additional settings if needed. The main configuration file is located at:
After making changes, restart MariaDB to apply them:
Your MariaDB server should now be up and running on Debian 12. Let me know if you need help with specific configurations!