MySQL数据库应用与开发基础指南.pdfVIP

  • 0
  • 0
  • 约3.78千字
  • 约 4页
  • 2026-01-26 发布于北京
  • 举报

Mysql?作用?在哪儿用?怎么用?优点?

支持的引擎MyISAMInnoDB支持的数据类型数值整型(bigintintint

smallinttinyint)浮点型(floatdouble)decimal日期时间datetimedatetimeyear

timestamp

字符串varcharcharlongtexttexttexttinytextLongblob

blobblobtinyblob枚举型(enumset)

创建数据库

_

创建数据库BookDB默认字符集utf8校对规则utf8_generalci;创建

_,namevarchar(20)

表创建表useinfo(idint主键自动增长

notnull,pwd

varchar(50)notnull)engine=innodb;修改表修改表名:altertable

userinforenametouser;添加字段:altertableuseraddgender

Boolean;(默认添加到最后)修改字段:altertableuserchange

genderemailtextnull;删除字段:altertableuserdropemail;删除

表Droptableuserinfo;删除数据库Dropdatabase数据库名称;

数据insertinto表名(字段1,字段2)values(值1,值2);修改数据

Update表名set字段名=值where条件;删除数据Deletefrom表名

where条件查询数据(高级查询,联合查询)Select*frominfo,uinfo

whereinfo.id=uinfo.id;Selectidfrominfo;Select*frominfo

whereid=1;Select*frominfolimit5;创建用户Createuser‘join’

@’localhost’identifiedby‘123456’给用户Grant

updateondb.tableto‘username@localhost’;撤回用户权限

Revokeupdateondb.tablefrom‘admin@localhost’;删除用户

_

Dropuser‘join’@’localhost’;视图Createviewaviewas

select字段1from

Mysql?作用?在哪儿用?怎么用?优点?

支持的引擎

MyISAMInnoDB

支持的数据类型

浮点型(floatdouble)decimal

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档