Websites

Accessing Your Database With phpMyAdmin

Every Kapsule website with a database gets browser based database access through phpMyAdmin, opened with single sign-on so there is no second password to keep. This guide covers opening it, reading your connection details, the operations worth doing there, and the two database jobs you should never do in phpMyAdmin on a WordPress site.

Opening phpMyAdmin

  1. Sign in to KPanel and click Websites in the left sidebar.
  2. Click your site.
  3. In the site's own menu, open Files, then Database.
  4. Click Open phpMyAdmin.

phpMyAdmin opens in a new tab, already signed in and pointed at your site's database. There is no login form and no separate credential to store.

Database tab on a site in KPanel

If the page says no database is provisioned for this site type, that is expected. Static HTML sites and some application types are created without one. Site types that use a database, including WordPress and WooCommerce, always have it.

Your Connection Details

The same screen shows the credentials your application uses, each with a copy button and the password hidden behind a reveal control:

FieldValue
Host127.0.0.1
Port3306
DatabaseYour database name
UsernameYour database user
PasswordHidden until you click reveal

These are the values that belong in wp-config.php, a .env file, or any framework's database configuration.

127.0.0.1 means "this server". It is not reachable from your laptop, and no amount of firewall configuration will change that: the database does not listen on a public address at all, by design. To connect a desktop client such as TablePlus or Sequel Ace, tunnel over SSH. See Connecting to Your Database Over an SSH Tunnel.

What to Use It For

phpMyAdmin earns its place for a specific set of jobs:

  • Reading data. Confirming what a plugin actually stored, checking whether a row exists, counting records.
  • Importing a database during a migration or a restore.
  • Exporting a database, either as an extra safety copy or to hand to a developer.
  • Repairing a single broken value, such as a siteurl that got typed wrongly and now locks you out of wp-admin.
  • Diagnosing size. Sorting tables by size shows you immediately when a log or transient table has grown out of control.

Importing a Database

  1. Open phpMyAdmin from the Database tab.
  2. Click your database name in the left panel.
  3. Click Import at the top.
  4. Choose the .sql file and click Go.

An import replaces matching tables. It does not merge.

Importing over a live database is destructive and immediate. Every row in a matching table is replaced by whatever is in the file, and there is no undo inside phpMyAdmin. Take a backup first from the site's Backups tab: Taking a Backup.

For a large dump, compress it to .sql.gz first, which phpMyAdmin accepts and which usually brings a file under the upload limit. If it is still too large, split it into several files by table, or open a ticket and we will import it server side for you.

Exporting a Database

  1. Click your database name in the left panel.
  2. Click Export.
  3. Quick with SQL format is right for a straight copy. Choose Custom if you need particular tables, or want the output gzipped.
  4. Click Go.

A phpMyAdmin export is a useful extra copy, not a backup strategy. It captures the database only, not your files, and it lives wherever you saved it. Your site is backed up automatically every day with both together, and you can take a manual one at any time: Taking a Backup.

Two Things Not to Do Here

Do not run a search and replace with SQL

WordPress stores plugin and theme settings as PHP serialised strings, which record the length of every value inside them. A REPLACE() query changes the text without changing the recorded length, so PHP can no longer read the option and it silently reverts to empty. Theme settings vanish, sliders empty out, licences deregister.

Use the Search & Replace card on the site's WordPress tab, which handles serialisation correctly and takes a backup first. Full explanation: Running a Search and Replace.

Do not reset a password by editing wp_users

Older guides tell you to set user_pass using the MD5 function from the phpMyAdmin dropdown. Modern WordPress does not use MD5 hashes, and getting this wrong locks out the account rather than resetting it.

KPanel has proper tools for this on the site's WordPress tab, then Users: sign straight in with Login as, send a reset email, or copy a reset link to send yourself. See Resetting a Lost WordPress Admin Password.

WordPress Database Tools in KPanel

For routine WordPress database work, the WordPress tab, then the Database section is safer and faster than phpMyAdmin. It gives you table sizes at a glance, optimise and repair with an automatic backup taken first, conversion of old tables to a modern storage engine, and one click cleanup of post revisions, auto-drafts, expired transients and trashed posts. Search and replace lives one section along, on Quick Actions.

Reach for phpMyAdmin when you need to look at raw rows. Reach for the Database section when you need to change something.

Troubleshooting

phpMyAdmin will not open. The button needs write access to the site. If your Kapsule account role is read only, ask an account owner. If you have write access and it still fails, the site may still be provisioning: check the status pill at the top of the site.

I cannot connect from my laptop with the details on the Database tab. Correct, and deliberate. The database is not exposed publicly. Use an SSH tunnel: Connecting to Your Database Over an SSH Tunnel.

The import stops with no error. Almost always the file size. Gzip it or split it.

I changed a value and the site broke. Restore from the most recent backup: Restoring From a Backup. This is why the backup comes first.

Tables have grown enormous. Sort by size in phpMyAdmin to find the culprit, then clean it up from the WordPress tab, then Database section rather than deleting rows by hand.

Still need help?

Email us at support@kapsulehost.com or open a chat in KPanel.

Open KPanel