1.查看当前所有的数据库:show databases;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/84c274ee8e018fff19fc9d774134265c.png)
2.打开指定的库:use 库名;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/6024aed665449910bb4829daf92d6d04.png)
3.查看当前库的所有表:show tables;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/eabb5f9654e7d98ff0b88aa0a65a8d39.png)
4.查看其它库的所有表:show tables from 库名;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3de3e7411a1c0e9d59871796a7444727.png)
5.创建表:
create table 表名(
列名 列类型,
列名 列类型,
…
);
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/bbe0d37d88b176b3b0aa962f9e9a6316.png)
6.查看表结构:desc 表名;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/d0a5840eabc9be110d7ecd023d3ba082.png)
7.查看服务器的版本:
方式一:登录到MySQL服务端
select version();
方式二:没有登录到MySQL服务端
mysql --version
或者
mysql --V
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/8f8297b95ff8cc026acd810bc9a3538f.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/5d2a6ea350e0f942eea1c9ed646346f8.png)