mysql之数据库操作-第一篇

1.数据库的创建

mysql> create database if not exists myTestDB;
Query OK, 1 row affected (0.00 sec)

2.查看可用的数据库列表

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| mytestdb           |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

3.删除数据库

mysql> drop database if exists mytestdb;
Query OK, 0 rows affected (0.00 sec)

4.使用数据库

mysql> create database if not exists mytestdb;
Query OK, 1 row affected (0.00 sec)

mysql> use mytestdb;
Database changed

 

posted @ 2020-04-27 23:40  长木木弓  阅读(165)  评论(0编辑  收藏  举报