创建MySQL用户数据库:

create database if not exists 数据库名字;

创建MySQL用户数据库_不添加条件:

create database 数据库名字;

设置MySQL默认字符集:

set character set utf8;

更改数据库名

alter database if not exists 数据库名字;

删除数据库

drop database if not exists 数据库名字;

常见字符集名称

  • ASCII字符集
  • GB2312字符集
  • BIG5字符集
  • GB18030字符集
  • Unicode字符集等。

创建数据库表:

create table abc();

建表:

use 用户名;
create table 名(
id int,
name char(12)
);

查看表

查看表:

describe 表名;

删除表

drop table if exists 表名1,表明2;

创建一个表

CREATE TABLE student1 (
    id int,
    name char(12),
    birthday date,
    addr char(211),
    tel char(11),
    img SET('jpg', 'png', 'gif'),
    scire float,
    remarks text
);
最后修改:2024 年 01 月 24 日
咱们谁跟谁,用不着~