Skip to main content

How to Access Your Site's Database

Instructions for managing your WordPress site's MariaDB database using Adminer, the command line (WP-CLI), and an SSH tunnel, as well as creating and importing database dumps (.sql) at Seravo.

In Seravo's hosting environment, each WordPress site has its own dedicated MariaDB database. For security reasons, traditional phpMyAdmin is not installed, and the database server does not accept direct connections from the public internet. Instead, you can manage your database securely in your browser using Adminer, via the command line (WP-CLI), or with a local database client over an SSH tunnel.

Prerequisites

  • Adminer in a browser: Requires Administrator privileges in the WordPress dashboard or your site's database credentials.

  • Command line and SSH tunnel: Requires a working SSH connection to the server.

Option 1: Adminer Database Tool (Browser)

Adminer is a lightweight, secure browser-based database management tool that provides functionality comparable to phpMyAdmin.

  1. Log in to your WordPress dashboard and navigate to Tools → Database (see Seravo Plugin – Database).

  2. Click Open Adminer (or go directly to https://example.com/.seravo/adminer and log in using the database credentials found in your environment variables).

Adminer view in a browser.

Main view of the Adminer database management tool in a browser displaying WordPress database tables.

Enabling or Disabling Adminer

For security reasons, Adminer may be disabled by default, causing /.seravo/adminer to return a 403 Forbidden error. You can check its status and toggle the feature via SSH:

# Check Adminer status (enabled / disabled)
srv feature adminer --status

# Enable Adminer
srv feature adminer --enable

# Disable Adminer when you are finished
srv feature adminer --disable

Option 2: Command Line (SSH and WP-CLI)

The fastest and most secure way to manage your database is via the command line over SSH, as WP-CLI reads your database credentials automatically without requiring manual authentication:

  • Open an interactive MariaDB shell:

    wp db cli
  • Run a single SQL query directly:

    wp db query "SELECT option_name, option_value FROM wp_options WHERE option_name IN ('siteurl', 'home');"

Option 3: Local Database Client (SSH Tunnel)

If you prefer using a graphical database client on your computer (such as TablePlus, DBeaver, or Sequel Ace), configure an SSH tunnel (Connection over SSH) in your client:

  • SSH settings: Enter your site's SSH host (example.fi-t.seravo.com), SSH port (12345), SSH username, and password or SSH key.

  • Database settings (inside the tunnel):

    • Host: 127.0.0.1

    • Port: 3306

    • Database, username, and password: Retrieve these values using wp-list-env as described below.

Where to Find Database Credentials and Environment Variables

If you inspect /data/wordpress/htdocs/wp-config.php, you will notice that database credentials are loaded dynamically using getenv() calls rather than hardcoded values.

To view your site's database credentials and other environment variables, connect via SSH and run:

wp-list-env

The primary database variables are DB_NAME (database name), DB_USER (database username), DB_PASSWORD (password), and DB_HOST (database host).

Creating and Importing a Database Dump (.sql)

Method 1: Via the Command Line (Recommended for Large Databases)

  • Create a fast-importing database dump (wp-db-dump -f):

    Seravo's helper command wp-db-dump -f uses extended INSERT syntax (fewer INSERT statements), making importing and restoring the SQL file significantly faster than with the standard wp db export command:

    # Save the database dump to a specified file (without a path, the file is saved under /tmp)
    wp-db-dump -f database-dump.sql

    (Alternatively, you can use the standard WP-CLI command wp db export.)

  • Import a database dump (wp-db-load):

    wp-db-load database-dump.sql
    wp-purge-cache

Method 2: Download the Nightly Dump via SFTP

Seravo automatically generates a fresh database dump every night in /data/db/. You can download this SQL file directly to your computer via SFTP without running a manual export.

Method 3: In a Browser Using Adminer

  1. Open Adminer and select Export from the left-hand menu.

    Selecting Export from the menu.

    Adminer left-hand navigation menu with the Export option highlighted.

  2. Select the tables you want to include and set Output to save (downloads an .sql file directly) or gzip (compressed .sql.gz file).

    Selecting specific tables to export in Adminer.

    Adminer Export view showing output format options and database table selection.

  3. Click Export to download the file.

Common Issues and Troubleshooting

  • Adminer returns a 403 Forbidden error: The Adminer feature is currently disabled. Enable it via SSH with srv feature adminer --enable. Remember to disable it again with srv feature adminer --disable once you are done.

  • Adminer export times out on a large database: Browser-based exports can time out if your database is hundreds of megabytes in size. For large databases, use wp-db-dump -f on the command line or download the nightly dump from /data/db/.

  • Changes do not appear on the site after editing the database: Direct database edits do not automatically invalidate server caches. Run wp-purge-cache via SSH or click Purge Cache in the WordPress top admin bar.

See Also

With Adminer, WP-CLI commands, and SSH tunneling, you can securely manage your site's MariaDB database in any workflow. If you need assistance with database connections or handling large database dumps, our customer support team is happy to help at [email protected].

Did this answer your question?