Connecting to your Database with WP-CLI
Last Updated -
SSH into your server and move into the site directory you need to manage. See also wp-cli database commands
$ cd /sites/domain-name/
Enter the following command:
$ wp db query
You should now see the following command prompt that indicates you have successfully connected to your database.
Tip: To view the subcommands for wp db enter the following command.
wp db --help