MySQL 库操作
1、库操作
- 展示本地所有库
- show databases;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cms |
| mysql |
| test |
+--------------------+
- 创建数据库
- create database + 库名;
# 创建 student 库 mysql> create database student; # 查看库 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | cms | | mysql | | student | | test | +--------------------+
- 选择进入某个数据库
- user + 库名;
mysql> use student;
Database changed
- 删除数据库
- drop database + 库名;
# 删除数据库 student mysql> drop database student; # 查看验证 student 库是否成功删除 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | cms | | mysql | | test | +--------------------+
作者:一个老宅男
微信:ZhengYing8887
出处:https://www.cnblogs.com/ZhengYing0813/
备注:本文版权归作者所有,欢迎转载和添加作者微信探讨技术,但未经作者同意必须在文章页面给出原文链接,否则保留追究法律责任的权利。