MySQL Cheatsheet
- Enter the database
mysql -u root -p
- List all databases
SHOW DATABASES;
- Switch to a database
USE [DB_NAME];
- List all tables in the current database
SHOW TABLES;
- List all data in a table
SELECT * FROM [TABLE_NAME];
- Get root random password generated by mysql docker
docker logs my-mysql 2>&1 | grep GENERATED
Be sure to log in as the root user afterwards