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