MySQL_(2)使用

登录和退出 MySQL,使用和查看数据库等基本操作。

MySQL_(2)使用

查看数据库(注意带上分号“;”)

show databases;

MySQL_(2)使用

可见已有三个数据库,分别是 “information-schema”、“mysql”、“performance-schema”。

连接数据库

选择连接其中一个数据库,语句格式为 use <数据库名>

这里可以不用加分号,这里我们选择 information_schema 数据库:

MySQL_(2)使用

查看表

使用命令 show tables;

查看数据库中有哪些表(注意不要漏掉“;”):

MySQL_(2)使用

退出

使用命令 quit 或者 exit 退出 MySQL

MySQL_(2)使用