Database Access
We 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.
While it may be common at some hosts to have to add a remote IP address to allow external DB connections, that isn’t necessary here at Kinsta. When an SSH tunnel is used to access a database (the methods described in this article) the connection is secured through the authentication process for SSH.
Access phpMyAdmin
Kinsta provides quick access to phpMyAdmin on all hosting plans. phpMyAdmin is a popular free application for managing MySQL databases.
To access phpMyAdmin and manage your WordPress database, log in to MyKinsta and navigate to WordPress Sites > sitename > Info.
Scroll down to the Database access section, and you’ll find your database username and password, which you’ll need to log in to phpMyAdmin.
To access the login page click the Open phpMyAdmin link.
![Open phpMyAdmin from MyKinsta.](https://kinsta.com/wp-content/uploads/2023/11/wordpress-phpmyadmin.png)
Enter your database username and password on the phpMyAdmin login page.
![phpMyAdmin login page.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F04%2Fkinsta-phpmyadmin-1.png&w=3840&q=75)
Once you’re logged in to phpMyAdmin, you can view your database tables, run queries, drop tables, import data, export your WordPress database, and more.
![Viewing your database in phpMyAdmin.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2021%2F11%2Fphpmyadmin-database.jpg&w=3840&q=75)
For more information about using phpMyAdmin, refer to the official phpMyAdmin documentation.
SSH and Database Information
In the connection methods shown below, you’ll need to gather SSH and database information for your site from MyKinsta. This information can be found in MyKinsta under WordPress Sites > sitename > Info.
- SFTP/SSH Host
- SFTP/SSH Username
- SFTP/SSH Password
- SFTP/SSH port
- Database name
- Database username
- Database password
![Credentials for setting up SSH tunneling can be found in MyKinsta.](https://kinsta.com/wp-content/uploads/2023/11/wordpress-ssh-database.png)
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.
- SSH username
- SSH password
- SSH host
- SSH port
- Database username
- Database password
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 -fN ssh_username@ssh_host -p ssh_port -L 3307:127.0.0.1:3306
For the kinstalife site in the screenshot above, the command below can be used to start the SSH session.
ssh -fN [email protected] -p 47780 -L 3307:127.0.0.1:3306
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.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fmacos-ssh-tunneling.png&w=3840&q=75)
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.
Use the command below for MySQL Shell to connect to your database.
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.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fmysqlsh-ssh-tunneling.png&w=3840&q=75)
Connect to Database with HeidiSQL
Below is an example of how to connect to your database directly using HeidiSQL.
Step 1 – Download and Install HeidiSQL
Download HeidiSQL and install it. When you first launch it you will need to create a new session file using the following information.
- Network Type: MySQL (SSH Tunnel)
- Hostname / IP: localhost (or 127.0.0.1)
- User: Database username from MyKinsta
- Password: Database password from MyKinsta
- Port: 3306
- Database: Database name from MyKinsta
![New session file HeidiSQL](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fnew-session-file-HeidiSQL-1.png&w=3840&q=75)
Step 2 – Download Plink.exe
You will then need to download Plink.exe (PuTTY Link, a command-line connection tool) and specify the location under the Advanced tab in HeidiSQL. Then use the following information on the SSH tunnel tab.
- SSH Host: SFTP/SSH Host IP Address from MyKinsta
- SSH Port: SFTP/SSH Port from MyKinsta
- Username: SFTP/SSH username from MyKinsta
- Password: SFTP/SSH password from MyKinsta
- Local port: 3306
![SSH tunnel settings in HeidiSQL.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2FHeidiSQL-plink.png&w=3840&q=75)
Step 3 – Add Key to the Registry
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 and Install Sequel Pro
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](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fsequel-pro.png&w=3840&q=75)
Step 2 – Add Connection Parameters
Fill in the following connection parameters:
- MySQL Host: 127.0.0.1
- Username: Database username from MyKinsta
- Password: Database password from MyKinsta
- Database: Database name from MyKinsta
- Port: 3306
- SSH Host: SFTP/SSH Host IP Address from MyKinsta
- SSH User: SFTP/SSH Username from MyKinsta
- SSH Password: SFTP/SSH Password from MyKinsta
- SSH Port: SFTP/SSH Port from MyKinsta
Step 3 – Connect
Click Connect.
Connect to Database with MySQL Workbench
Step 1 – Download and Install MySQL Workbench
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 – Add Connection
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](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fmysql-workbench-connection-1.png&w=3840&q=75)
Step 3 – Choose Connection Method
Choose Standard TCP/IP over SSH from the connection method drop-down menu.
Step 4 – Add Connection Parameters
Fill in the following connection parameters:
- SSH Hostname: SFTP/SSH Host IP Address followed by a colon (:) and port from MyKinsta (e.g. 123.123.12.123:53229)
- SSH Username: SFTP/SSH Username from MyKinsta
- SSH Password: SFTP/SSH Password from MyKinsta
- MySQL Hostname: localhost
- MySQL Server Port: 3306
- Username: Database username from MyKinsta
- Password: Database password from MyKinsta
Then click Close.
Step 5 (Windows Users Only) – Update System Type
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:
- System Type: Linux
- Installation Type: Ubuntu Linux (MySQL Package)
![MySQL Workbench system profile](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fmysql-workbench-system-profile.png&w=3840&q=75)
Then under the Remote Management tab, switch it back to Do not use remote management.
Step 6 – Connect
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](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fssh-server-fingerprint-missing.png&w=1080&q=75)
![MySQL Workbench connection warning](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F08%2Fmysql-workbench-connection-warning.png&w=828&q=75)
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.