1. Log in to mysql

Mysql -u root -p password

Root is the user name. The default value is root. Password Indicates the password you set

After login:

2. View the database

Command line: show databases;

3. View all lists of a database

Command line: show tables from mysql;

Mysql is a replaceable database name.

4. View all columns of a list in a database

Enter the following commands in sequence:

use mysql; Select (enter) a database. Mysql is the name of the database

show tables; Mysql > select * from table_name

show columns from tableName; TableName is the name of the table and is replaceable

5. View the data for a list

Select * from tableName;

6. Logout mysql

Command line: quit or exit