đź“ť Edit page
âž• Add page
MySQL
The world's most popular open source database
Console
Connect to DB
Note no space between -p
and your password.
$ mysql -u my_user --database my_db -pPASSWORD
Note that your password will be saved in your shell’s history or commands.
Or, the more secure way.
$ mysql -u my_user --database my_db -p
Then enter your password and press enter.
Manage as root
$ mysql -u root -p
Then enter the DB’s root user password.
Schema
List tables
See Show Tables docs reference.
SHOW TABLES;
Describe table
See tutorial.
DESCRIBE my_table;
-- OR
DESCRIBE my_db.my_table;