Yes, we do offer direct database access as well as the ability to manipulate databases with tools like phpMyAdmin, HeidiSQL, Sequel Pro, and MySQL Workbench. In order to configure direct database access, you’ll need to set up an SSH tunnel to your Kinsta site. Check out a few different ways you can connect below.

Connect to Database with phpMyAdmin

You can connect to your WordPress database using phpMyAdmin, which is accessible from within MyKinsta.

Access phpMyAdmin in MyKinsta.
Access phpMyAdmin in MyKinsta.

Connect to Database with Command Line

If you prefer to work exclusively in the command line, you can connect to your Kinsta database directly via an SSH tunnel. This allows you to use local database administration tools like MySQL Shell to make changes to a MySQL database in a secure fashion.

To connect to your database via SSH tunnel, you’ll need a few key pieces of information from your site’s Info tab in MyKinsta.

Credentials for setting up SSH tunneling can be found in MyKinsta.
Credentials for setting up SSH tunneling can be found in MyKinsta.

macOS

In macOS, launch Terminal and run the command below. Be sure to replace “ssh_username”, “ssh_host”, and “ssh_port” with your site’s settings. This command binds your local port 3307 to port 3306 on the remote server containing your database and performs the necessary port forwarding.

ssh [email protected]_host -p ssh_port -L 3307:127.0.0.1:3306 -N

For the kinstalife site in the screenshot above, the command below can be used to start the SSH session.

ssh [email protected] -p 47780 -L 3307:127.0.0.1:3306 -N

Input your SFTP/SSH password when prompted, and press “Enter”. If you do not see an “incorrect password” message, that means you’re good to go!

SSH tunnel in macOS.
SSH tunnel in macOS.

At this point, your Mac is set up to connect to your remote database via 127.0.0.1:3307. If you haven’t already, you’ll need to install MySQL Shell locally. To test this, you can use the command below for MySQL Shell in a different terminal window.

mysqlsh --host=127.0.0.1 --port=3307 -u database_username -p --sql

For our kinstalife site, we would use the command below.

mysqlsh --host=127.0.0.1 --port=3307 -u kinstalife -p --sql

You’ll be prompted for your database password, so be sure to have that handy. After successfully connecting, you’ll see the SQL interface below which lets you query your remote database directly.

MySQL Shell on macOS.
MySQL Shell on macOS.

Connect to Database with HeidiSQL

Below is an example of how to connect to your database directly using HeidiSQL.

Step 1

Download HeidiSQL and install it. When you first launch it you will need to create a new session file using the following information.

New session file HeidiSQL
New session file HeidiSQL

You can find your MySQL username, password, and database name in MyKinsta under Sites > sitename > Info.

Database credentials in MyKinsta.
Database credentials in MyKinsta.

Step 2

You will then need to download Plink.exe and specify the location under the Advanced tab. Then use the following information.

heidisql plink

Again, all of the information above can be obtained from MyKinsta under Sites > sitename > Info.

Step 3

Click Open and it should prompt you to trust the host and add the key to your registry.

Connect to Database with Sequel Pro

Below is an example of how to connect to your database directly using Sequel Pro.

Step 1

Download Sequel Pro and install it. When you first launch it you will need to create a new connection. Click on the SSH tab.

Sequel Pro
Sequel Pro

Step 2

You can find your MySQL username, password, and database name in MyKinsta under Sites > sitename > Info. Fill in the following connection parameters:

Step 3

Click “Connect.”

Connect to Database with MySQL Workbench

Step 1

Download MySQL Workbench and install it. When you first launch it you will need to create a new session file using the following information.

Step 2

Open Workbench and create a new connection. To do this, click on the Database menu → Manage Connections. Then click on the New button and give your connection a name.

MySQL Workbench connection
MySQL Workbench connection

Step 3

Choose Standard TCP/IP over SSH from the connection method drop-down menu.

Step 4

You can find your MySQL username, password, and database name in MyKinsta under Sites > sitename > Info. Fill in the following connection parameters:

Then click Close.

Step 5 (Windows Users Only)

If you’re running Windows, you will need to update the system type under the System Profile tab. However, by default, these options are greyed out. To enable them, click on the Remote Management tab and enable Native Windows Remote Management temporarily.

This will enable you to change configuration options in the System Profile tab. Update the following:

MySQL Workbench system profile
MySQL Workbench system profile

Then under the Remote Management tab, switch it back to Do not use remote management.

Step 6

Open the connection from the list. You will probably see two pop-up windows: SSH Server Fingerprint Missing and Connection Warning. Click Continue on both windows.

SSH server fingerprint missing
SSH server fingerprint missing
MySQL Workbench connection warning
MySQL Workbench connection warning

You should then be able to access and manage the database.

If you get the following error: “Incompatible SSH peer (no acceptable kex algorithm)” it’s letting you know your Workbench software is out of date. However, we’ve had reports from clients about a possible bug with the “check for updates” option reporting they were already running the latest version when in fact they weren’t. The solution is to go to the download page and grab the latest version.