You can work with the database from inside the VM with WP CLI or
mysql, and even from PHPMyAdmin, but some users prefer software such as HeidiSQL, or Sequel Ace.
To connect using an external sql client, there are two methods:
- Direct connections
- SSH tunnel
There are also some client specific methods available:
- Beekeper Studio import URL
- TablePlus URL
- Sequel Pro/Sequel Ace config file
Any client you use should be able to use the details listedunder direct connections. We’ll be using Sequel Ace to demonstrate, but the same goes for any other software you might prefer to use.
These details can be used with any SQL client. To do this, you need to connect to the Virtual Machine, not localhost, using the username and password
external. This type of connection is useful for PHPStorm.
Leave the database field blank. If asked for a database type, choose MariaDB, or MySQL if that isn’t an option.
Here is an screenshot from Sequel Pro/Ace for reference:
Beekeper Studio import URL
Click on import from URL and enter
mariadb://email@example.com:3306 then click import. You should now click on connect, and select a database in the top left dropdown.
For more information about Beekeeper Studio, click here.
Add a new connection, and import this URL:
Predefined Sequel Pro/Ace Config
A saved config file can be found at
database/sequelpro.spf, importing this file into Sequel Pro or Sequel Ace will configure a database connection automatically.
The VVV team recommend Sequel Ace over Sequel Pro
Using an SSH Tunnel
Similar to the Direct connection, choose the SSH option. Then, you will need to tell the software how to SSH into VVV, and the MySQL details to use once it’s inside.
Note that a direct connection is often easier and simpler to configure.
Leave the database and port fields blank.