EN
MySQL / cmd - most useful commands
0
points
In this article, we would like to show you the most useful cmd commands for MySQL.
1. Login user
Quick solution:
mysql -u root -p
Full command:
mysql --user=<username> --password=<password>
Note:
If you didn't specify password during mysql installation use the following command:
mysql --user=root --password=
2. Show databases
Quick solution:
SHOW databases;
3. Create / Drop database
Quick solution:
CREATE DATABASE database_name;
DROP DATABASE database_name;
4. Use / switch database
Quick solution:
USE database_name;
Note:
To switch database simply use the above command with a different
database_name
.
5. Show tables
Quick solution:
SHOW tables;
6. Create / Drop table
Quick solution:
CREATE TABLE table_name;
DROP TABLE table_name;