Skip to content

Creating and Managing MySQL Databases in Webmin

Webmin · Self-help guide

Most dynamic websites need a database. WordPress, Laravel, ecommerce systems, CRM tools and custom applications often rely on MySQL or MariaDB to store content, users, settings and orders. Webmin provides database management tools that let you create databases and users without using command-line SQL.

Step 1: Log in to Webmin and open Servers, then MySQL Database Server. If prompted, enter the database administrator credentials. These may be different from your Webmin login.

Step 2: Create a new database. Use a clear name linked to the website or application, such as clientsite_prod or laravel_app. Avoid vague names like test or newdb on production servers.

Step 3: Create a database user for the application. Do not use the root database account inside website configuration files. A dedicated user is safer and easier to revoke later.

Step 4: Assign permissions. Most applications need SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER and INDEX on their own database. Avoid giving global privileges unless required.

Step 5: Add the database name, username, password and host to the application configuration file. For Laravel this is normally the .env file. For WordPress it is wp-config.php.

Step 6: Test the site or application installer. If it cannot connect, check the password, database host, user permissions and whether the MySQL service is running.

Back up databases regularly before upgrades or migrations. A website can often be rebuilt from files, but lost database content is much harder to recover.

Looking for reliable VPS hosting with Webmin pre-installed? Online Audience provides high-performance VPS solutions with full root access, free migrations, expert help, and flexible hosting packages for websites, developers, agencies, and growing businesses. Visit OnlineAudience.co.uk to learn more.

Did this solve it?If not, Penny and the support team are ready to help.Start live chatOpen a ticket