1.查看所有数据库
show databases;
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| test |
±-------------------+
5 rows in set (0.00 sec)
2.选择数据库
use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
3.查看所有表
show tables
±---------------+
| Tables_in_test |
±---------------+
| one |
±---------------+
1 row in set (0.00 sec)
4.查看表数据
select *from one;
mysql> select *from one;
±-----±---------+
| id | name |
±-----±---------+
| 1 | xiaoming |
±-----±---------+
1 row in set (0.00 sec)