mysql基础语句(1)

  1. 开启关闭mysql:net start | stop
  2. mysql用户名 打开mysql: mysql -uroot -p
  3. 开启关闭输出日志:/T | /t
  4. 新建数据库:create database [if not exists] 数据库名
  5. 显示现有数据库:show databases
  6. 打开数据库:use 数据库名
  7. 创建表:create table 表名(字段名1 字段类型 [primary key] [auto_increment] [not null] [default],字段名2 字段类型)
  • [ primary key] : 主键,关键字
  • [auto_increment] :自增长,只能用于主键
  • [not null] : 非空
  • [default] :默认值
  1. 显示存储引擎:show engines
  • [默认 ] InnoDB

猜你喜欢

转载自blog.csdn.net/weixin_45936162/article/details/105799973