0
点赞
收藏
分享

微信扫一扫

5 删除表 -- MySQL数据库

1.连接MySQL数据库

$ mysql -uroot -p -P3306
	-- 输入密码登录

7.png

2.查看所有数据库

mysql> show databases;

8.png

3.选择(使用)数据库

mysql> use test1;

9.png

4.查看选择的数据库中的所有表

mysql> show tables;

10.png

5.删除表后查看

1.删除表,要注意,数据很重要
mysql> drop table emp2;

2.查看表是否已经删除
mysql> show tables;

11.png

6.删表操作注意

1.如果删除没有的表,会报错

2.如果你要删表,又不确定表是否存在,可以加条件
	-- 例如: drop table if exists emp2;

12.png

举报

相关推荐

0 条评论