[Database] MySQL - database operations

1. Create a database

create database [if not exists] `数据库名` charset=字符编码(utf8mb4);
  1. If you create will complain many times
  2. Character encoding is not specified, the default utf8mb4
  3. ⼀ to the database name given to customary anti add quotation marks, prevents shifting and keyword conflicts

2. Check database

show databases;

3. Select the database

use `数据库名`;

4. Create a database

create database `数据库名`;

5. Modify the database

-- 只能修改字符集 
alter database `数据库名` charset=字符集;
  1. Delete Database
drop database [if exists] `数据库的名字`;
Published 116 original articles · won praise 10 · views 1352

Guess you like

Origin blog.csdn.net/weixin_44727383/article/details/104999413