02.DDL-数据库操作

1.查询
a.出查询所有数据库

show databases;

b.查询当前数据库

select databases();

2.创建

create database [if not exists] 数据库名 [default charset 字符集] [collate 排序规则]
注意: UTF8字符集长度为3字节,有些符号占4字节,所以推荐用utf8mb4字符集

3.删除

drop database [if exists] 数据库名

4.使用

use 数据库名
posted @ 2024-09-06 15:53  test369  阅读(1)  评论(0编辑  收藏  举报