For one query, wp db query is enough. To poke around for a while, I’d want a real prompt.
wp db cli
This starts the mysql client (or mariadb) with the database name, user, password and host from wp-config.php. You land on a mysql> prompt in the right database, so SHOW TABLES; works right away. Type exit to leave.
Extra flags go through to the client. I like --pager=less for wide tables, and --database= lets you open another database with the same user. The character set comes from DB_CHARSET, so text with accents shows up properly.
Your own ~/.my.cnf is skipped on purpose, so a wrong setting in there cannot break the login. Add --defaults if you do want it.
The client has to be installed on the machine where WP-CLI runs. In the official WordPress Docker image it is not. And of course this is a live prompt on your production data: an UPDATE without a WHERE runs on every row and there is no undo. Export first if you plan to change things.
Further reading: wp db cli