While it isn’t common, there may be times you need to access your Flywheel site’s database using an external tool instead of the Database manager in your Flywheel dashboard. Thanks to our SSH gateway and a nifty feature called SSH tunneling, you can do just that.
SSH tunneling allows you to set up a secure connection to transmit data via an encrypted SSH connection. In our example here we’ll be setting up MySQL Workbench, a visual database design tool, but the concepts will apply to any number of tools that can connect to a server via SSH tunneling.
That said, it’s always a good idea to create a fresh backup before altering your database.
1. Prep
2. Connection settings
3. Finding your username
4. Finding your site-slug
5. Save and test the connection
cat ~/.my.cnf
to view your site’s my.cnf file to get the host IP address, database user, and database password. Alternatively, you can download a copy of your site’s wp-config.php file and get the DB_HOST, DB_USER,
and DB_PASSWORD
values.In your chosen tool, fill in the connection settings to set up the connection with your Flywheel site’s database. Here’s an example in MySQL Workbench:
Connection Name: | The name of the site or really any meaningful name you want to give the connection |
Connection Method: | Standard TCP/IP over SSH |
SSH Hostname: | ssh.getflywheel.com |
SSH Username: | username+site-slug or team+org-name+site-slug |
SSH Password: | leave this field empty |
SSH Key File: | upload the private key file created when you generated your SSH keys |
MySQL Hostname: | host IP address from my.cnf or DB_HOST IP address from wp-config.php |
MySQL Server Port: | 3306 |
Username: | user from my.cnf or DB_USER from wp-config.php |
Password: | password from my.cnf or DB_PASSWORD from wp-config.php |
Your SSH username begins with your Flywheel username, which can be found a couple of different ways:
The second part of your SSH username is the site-slug, which can be found in a couple places:
Once you’ve got everything filled out, you can test and save your connection settings. Now you can connect to your Flywheel site’s database whenever you want to!
If you’re have any questions about connecting to your database via SSH tunneling, reach out to our Happiness Engineers who would be more than happy to help!
New to Flywheel? Start here, we've got all the information you'll need to get started and launch your first site!
How to migrate your site to Flywheel using Flywheel Migrations
How do I go live on Flywheel?
What is a demo site?
Learn all about managing your Flywheel user account, Teams and integrations.
Your role as a collaborator
How do I transfer a subscription to/from an Organization?
What is a collaborator in Flywheel?
Flywheel hosting plans include a ton of great features. Learn about how to get a free SSL certificate, set up a staging site, and more!
Deploying to Flywheel via SSH and GitHub Actions
How do I get started with Staging?
Backups on Flywheel
All the server and setting info you'll need to help you get the most out of your Flywheel hosting plan!
Connecting to Flywheel’s SSH Gateway
Can I access my Flywheel site via SSH?
Can I get access to my database?
Tips and tricks for managing your sites on Flywheel, including going live, troubleshooting issues and migrating or cloning sites.
View allLearn how to connect, deploy, and more with SSH on Flywheel's platform.
Using SSH tunneling to access your site’s database
Deploying to Flywheel via SSH and GitHub Actions
Connecting to Flywheel’s SSH Gateway
We can help! Check out our Brand Resources page for links to all of our brand assets.
Brand Resources