Skip to content

Knowledgebase

Managing a database and user for a Virtualmin website

control-panels, development

Create and manage an application database inside the correct Virtualmin domain so ownership, permissions and backups remain associated with the hosting account. Choose the database engine required by the application rather than treating MySQL, MariaDB and PostgreSQL as interchangeable.

What you need before you begin

Check installed database services, account limits and application compatibility. Decide the database name and credential scope. Back up an existing database before importing SQL or changing users, and keep database credentials out of public files and screenshots.

01 Manage a database and user for a Virtualmin website

  1. Select the domain from the navigation dropdown and open Edit Databases. Choose Create a new database.
  2. Enter a descriptive name and select the appropriate available database server type. Create it and note the exact final name.
  3. Review the domain database login and any additional user permissions available through the domain user controls. Use credentials limited to the required application data rather than the server database administrator.
  4. Configure the application with the actual database host, full database name and permitted user. Use protected configuration or secret storage and test a connection.
  5. For an import, inspect the SQL scope first and preserve the destination database. SQL containing DROP or broad administrative statements can affect more than an expected table update when run with excessive privileges.
  6. Use Manage for the intended database to inspect tables, perform authorized SQL or create a database backup. Verify inclusion in the broader virtual-server recovery plan.

Will changing the database username update my application?

Do not assume so. Applications often store the login in their own configuration. Update and test each dependent application after an authorized credential or username change.

Confirm the expected result

Test an application read and controlled write. Confirm the user has only the intended database access and that a backup restores successfully in isolation. Check the database character set and application requirements before importing production data.

Troubleshoot unexpected results

For authentication errors, compare username, host and privileges before resetting passwords. Renaming the domain database login requires updating applications that store that name. Do not repair a connection failure by granting global privileges or opening the database to every remote address.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support