网站建设带支付源码小米应用商店安装下载
- 作者: 五速梦信息网
- 时间: 2026年04月20日 07:51
当前位置: 首页 > news >正文
网站建设带支付源码,小米应用商店安装下载,可用来制作网页的软件有,河南网站营销seo电话数据库概念
关系型数据库 数据结构二维表格 库 - 表 - 列#xff08;字段#xff09;#xff1a;用来描述对象的的一个属性#xff1b;行#xff1a;用来描述一个对象的信息
mysql#xff08;5.7⁄8.0#xff09; maridb ocracle postgresql sqlserver(windows…数据库概念
关系型数据库 数据结构二维表格 库 - 表 - 列字段用来描述对象的的一个属性行用来描述一个对象的信息
mysql5.7⁄8.0 maridb ocracle postgresql sqlserver(windows)
RDB阿里云数据库 高斯华为的 TDBA腾讯的ocenabase阿里的人大金仓 达梦
非关系型数据库
缓存型的 redis memcache
文档型的 mongoDB
搜索型的 elasticserch
时序型的 prometheus(监控数据)
常见操作系统 欧拉乌班图apt安装deb包
键值对 k/y key/value 键/值
sql语句 DDL创建数据库对象 DML内容 DQL搜索 DCL控制语句
DDL 用于创建数据库的对象库 表 索引
create database 库名
create table 表明 字段名1 数据类型 【字段属性】【字段属性】 … .;
show databases;查看库
use 库名
show tables
show tables from 库名
desc 表名查表得结构
DML 用于管理表数据
insert into 表名 字段1字段2… . values(对应字段1的值字段2的值 … . );
insert into 表名 values 按照字段顺序的所有字段的值
delete from 表名 where 条件表达式
update 表明 set 字段值 … . where 条件表达式
DQL 用于根据条件查询表数据
select 字段1字段2 … from 表名 where 条件表达式
select * from 表明 limite NN查看表前几行
select * from 表明 limite N,M查看N行之后的多少行到M前那行不包含第N行
select * from 表明/G按竖向结构查看
需改表结构 alter table 旧表名 rename 新表名
增加表字段 alter table 表明 add 新字段 数据类型 字段属性
修改表字段名 alter table 表明 cahnge 旧字段名 新子段名 字段属性
删除字段 alter table 表名 drop 字段名 char和varchar的区别 char大小固定值小的往后空格varchar可变的最小为1
案例扩展 use school; create table if not exists info ( id int(4) zerofill primary key auto_increment, #指定主键的第二种方式 name varchar(10) not null, cardid int(18) not null unique key, hobby varchar(50)); ———————————————————————————————————————— #if not exists表示检测要创建的表是否已存在如果不存在就继续创建 #int(4) zerofill表示若数值不满4位数则前面用0填充例0001 #auto_increment表示此字段为自增长字段即每条记录自动递增1默认从1开始递增; 自增长字段数据不可以重复;自增长字段必须是主键;如添加的记录数据没有指定此字段的值且添加失败也会自动递增一次 #unique key表示此字段唯一键约束此字段数据不可以重复:一张表中只能有一个主键但是一张表中可以有多个唯一键 #not null表示此字段不允许为NULL
主键字段不能为空一个表中只能有一个主键所有字段中主键字段唯一 唯一键可以空一个表可有多个唯一键。但一个表内不能重复
自增长命令执行失败id会自增一边
create table if not exists ky27 id int4 zerofill primary key auto _incrementname char(10) not null default nobody,phone int not null,sex char(4));
insert into ky27 (name,phone,sex) values (zhangsan,123456789,男)
alter table ky27 add unique key(phone);
克隆表
法一create table test1新表 like test2旧表
insert into test1 select * from test2 ;
法二
create table test2 select * from test2
会出现新旧表结构不一样
清空表法一
delete from test1 用delete删除时自增长字段仍然会按照星空前的顺序自增一条一条删清空效率慢
法二 truncate table test1直接重建表清空效率快新表自增长从1开始
创建临时表当前会话当中 show tables看不到表名
create temproary table test1 id intname char10sex char4
mysql 六大常见约束
主键约束 primay key
唯一键约束 unique key
非空约束 not null
默认值约束 default
自增约束 auto_increment
外键约束 foreign key 两个表关联表的的内键与另一个表的外键捆绑。
外键的定义如果同一个属性字段X在表一中是主键而在表二中不是主键则字段X称为表二的外键。
创建主表 profession
create table prof pid int pname char10
create table student id int name varchar10age int proid int
pid 与proid相关
alter table prof add primary keypid
desc prof
alter table student add constraint FK_pro_foreign key (proid) references prof (pid);插入数据时必须先给主表插入数据insert into prof values (1,大数据)
insert into student values (1,yht,26,1); 外键表删delete from student 查看表结构 show create table student\G更详细。
alter table student drop foreign key FK_PRO;删除表结构 DCL 数据库用户管理
create user 用户名源地址 identified by 密码源地址为localhost/%
select userlocalauthentcation_string form mysql.user;
查看用户
rootlocalhost默认用的localhost登录
root% 不同ip链接用户
新建用户 create user zhangsanlocalhost identified by abc123;
select password(123456);
create user lisilocalhost’
select user查看当前登录用户
rename user lisilocalhost to wangwulocalhost
drop user wangwulocalhost;
set password password(123456);该当前用户密码
set password for zhangsanlocalhost password(abc123)只等用户修改密码
寻找root密码
vim /etc/my.cnf 可以在【mysqld】下添加skip-grant-tables
修改 重启mysql
systemctl restart mysql
mysql
uae mysql
desc user
update user set authenticaton_stringpaassword(abc123) where userroot and hostlocalhost;
flush privileges;刷新
改完后
还原修改配置文件
vim /etc/my.cnf 刷新数据库 数据库的用户授权
grant 权限1权限2… . on 库名.表明 to 用户名源地址 [identified by 密码] 授权用户权限是 all privilege。这个all privilege 都有哪些权限?all privilege 权限如下 insert (插入数据)select (查询数据)
update (更新表的数据)
delete (删除表中数据)
create (创建库表)
(删除库表)drop
refernces
index(建立索引)alter(更改表属性)
create temp orary tableslock tables (锁表)
execute
create view (创建视图(显示视图)show viewcreate routine (创建存储过程alter routine(修改存储过程)event (事件)
trigger on(创建触发器
grant selectinsertcreate on kgc.* to lisi% identified by 123456;
flush privileges;
mysql -ulisi -p123456 -h 192.168.232.105 -p 3306
查看用户自己有什么权限
show grants for lisi%
grant all privileges on . to zhagnsanlocalhost;
撤销权限
revoke all on . from zhangsanlocalhost;
删除用户
drop user zhangsanlocalhost;
- 上一篇: 网站建设带有注册账号网站怎么被收录
- 下一篇: 网站建设单位不给数据库wordpress管账
相关文章
-
网站建设带有注册账号网站怎么被收录
网站建设带有注册账号网站怎么被收录
- 技术栈
- 2026年04月20日
-
网站建设代码实例博客X WordPress主题
网站建设代码实例博客X WordPress主题
- 技术栈
- 2026年04月20日
-
网站建设代理招标长沙软件开发公司
网站建设代理招标长沙软件开发公司
- 技术栈
- 2026年04月20日
-
网站建设单位不给数据库wordpress管账
网站建设单位不给数据库wordpress管账
- 技术栈
- 2026年04月20日
-
网站建设单一来源谈判文件社交网站解决方案
网站建设单一来源谈判文件社交网站解决方案
- 技术栈
- 2026年04月20日
-
网站建设当前位置图标建设婚介网站
网站建设当前位置图标建设婚介网站
- 技术栈
- 2026年04月20日
