MYSQL的增.删.查.改 注册.授权 #创建一个对数据库中的表有一些操作权限的用户,其中OPERATION可以用all privileges替换,DBNAME.TABLENAME可以用*替换,表示全部 mysql> grant OPERATION on DBNAME.TABLENAME to 'USERNAME'@'IP_ADDR' [identified by 'PASSWD']; mysql> create user 'USERNAME'@'IP_ADDR' identified b
数据准备: 创建表: create table students( id int unsigned primary key auto_increment not null, name varchar(20) default '', age tinyint unsigned default 0, height decimal(5,2), gender enum('男','女','人妖','保密'), cls_id int unsigned default 0, isdelete bit defau
Mysql 快速指南 本文的示例在 Mysql 5.7 下都可以测试通过. 知识点 概念 数据库(database):保存有组织的数据的容器(通常是一个文件或一组文件). 数据表(table):某种特定类型数据的结构化清单. 模式(schema):关于数据库和表的布局及特性的信息.模式定义了数据在表中如何存储,包含存储什么样的数据,数据如何分解,各部分信息如何命名等信息.数据库和表都有模式. 列(column):表中的一个字段.所有表都是由一个或多个列组成的. 行(row):表中的一个记录. S
MySQL之单表查询 创建表 # 创建表 mysql> create table company.employee5( id int primary key AUTO_INCREMENT not null, name varchar(30) not null, sex enum('male','female') default 'male' not null, hire_date date not null, post varchar(50) not null, job_description