付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1001-u 用户名 -u root -root用户“123”登2-h 主机地址 -u-h 172.18.8.8 -u root -root用户“123”在主机172.18.8.8上登3net startnet 开服4net stopnet 关服5show 6create databasecreate database 创建名为“wg”7create database if not existscreate database if not exists 如果不存在名为“wg”8select 9select 1001-u 用户名 -u root -root用户“123”登2-h 主机地址 -u-
2、h 172.18.8.8 -u root -root用户“123”在主机172.18.8.8上登3net startnet 开服4net stopnet 关服5show 6create databasecreate database 创建名为“wg”7create database if not existscreate database if not exists 如果不存在名为“wg”8select 9select select select select useuse 打开”wg”show create table字段名数据类型 完整性约束条件字段名数据类型 完整性约束条件字段名数据类型
3、 完整性约束条件create table primarykeyauto_increment, xingming varchar(15) not null,xingbieenum(m,w), csrq date,dianhuavarchar(11)notnull, dizhi varchar(50),youbian gongzidecimal(8,2)default0.00, beizhu textstudent字段,定长字符,长度为create tablecreate table student字段名数据类型 完整性约束条件字段名数据类型 完整性约束条件字段名n数据类型 完整性约束条件 ind
4、ex 索引名(字段名1,字段名2,.primarykeyauto_increment, xingming varchar(15) not null,xingbieenum(m,w), csrq date,dianhuavarchar(11)notnull, dizhi varchar(50),youbian gongzidecimal(8,2)default0.00, beizhu text,字段,定长字符,长度为namecname字段名数据类型 完整性约束条件字段名数据类型 完整性约束条件字段名n数据类型 完整性约束条件 index 索引名(字段名1,字段名2,.primarykeyauto
5、_increment, xingming varchar(15) not null,xingbieenum(m,w), csrq date,dianhuavarchar(11)notnull, dizhi varchar(50),youbian gongzidecimal(8,2)default0.00, beizhu text,字段,定长字符,长度为namecnamedescdesc studentdescribedescribe studentshow keys fromshow keys from studentshow index fromshow index from student
6、drop table studentaltertable表名add字段名数据类型完整性约束 |after 属性名;altertablestudentaddsaldecimal(8,2) default 0.00 after birth;8位,小数点后保留2位,默认值为alter table 表名change旧字段名新字段名 新数据类型;altertablestudentchangebirthbirthday studentbirthbirthdayalter table 表名modify字段名新数据类altertablestudentmodifysalstudentsalalter table
7、 表drop 字段名alter table student drop studentagealter table 旧表名 rename toalter table student rename to studentrename table 旧表名 torename table student to studentstu,create table 新表like to 旧表名create table stu2 like 数createtableasselect*fromcreate table stu2 select * from 创建一个与student表结构相似的stu2表,同数o表名valu
8、es(字段值1,字段值 字段值n);o stu 向stu表中的每个字段按数o (字段1,字段2.)values(字段值1,字段值o 向stu表中的某些字数oselectfrom名where 子句 ;o stu2 select * from 将stu表中的所到与其表结构相似的stu2表delete from 表名 wheredelete from stu where id truncate tabletruncate table stuupdateset1=新的字段值1段名2=新的字段值2 whereupdate stu set age=21 where 将stu表中id为2对应的age字段的值
9、修改为select 查询字段 from 表名 whereselect * from stuselect max(字段名) fromselect max(sal) from stusalselect min(字段名) fromoselectfrom名where 子句 ;o stu2 select * from 将stu表中的所到与其表结构相似的stu2表delete from 表名 wheredelete from stu where id truncate tabletruncate table stuupdateset1=新的字段值1段名2=新的字段值2 whereupdate stu se
10、t age=21 where 将stu表中id为2对应的age字段的值修改为select 查询字段 from 表名 whereselect * from stuselect max(字段名) fromselect max(sal) from stusalselect min(字段名) fromselect min(sal) from stusalselect avg(字段名) fromselect avg(sal) from stusalselect sum(字段名) fromselect sum(sal) from stusalselect count(字段名) fromselect cou
11、nt(id) from stuidcreateindex索引名on表名(字段名1,字段create index in_name on stunamein_namedrop index 索引名 ondrop index in_name on stuin_namesetPasswordfor用户名主机地set password for 将本地root用户修改为.usersetPassword=password()whereHost=主机名andUser=用.user set Host=locallostandUser=root;将本地root用户的flush dump -hu-all-dump -
12、uroot -all-root用户“123”将所有数据库备份到d盘的all.sql文件dump -hu-database 数据库名1dump -uroot -p123 root用户以数据库备份到d盘的dump -h主机地址 -u用户名-p库名 表名backupfile.sqldump -uroot -p123 wg root用户123source source 还原dall.sqlcreateuser用户名主机地址identified by createuseralicelocalhostidentifiedby “alice,“alice,“%”drop user 用户名drop user
13、删除本地“alice”grant权限列表on库.表tousername主机地址identified by grantallon*.*totom%identified 赋予tom在任主中所有数据库的revoke 权限列表 on 库名.表名 fromrevoke all on *.* from 收回tom在任主中所有数据库的cd cd cd cd 盘符D:cd 当前目录为d“cd wg1212a”下dir dir c:windowsdir drive:pathfilename dir c:windows dirdrive:pathfilename dir c: 显示c盘符:path del 删除d
14、wg1.txt盘符:path filename.ext revoke 权限列表 on 库名.表名 fromrevoke all on *.* from 收回tom在任主中所有数据库的cd cd cd cd 盘符D:cd 当前目录为d“cd wg1212a”下dir dir c:windowsdir drive:pathfilename dir c:windows dirdrive:pathfilename dir c: 显示c盘符:path del 删除dwg1.txt盘符:path filename.ext del 安静模式下删除dwg1.txt盘符:path filename.ext de
15、l 强制删除dwg1.txtmd drive: md wg(文件夹rd /s /q rd wgrd /s /q rd wg /s wg(其中/s/q/stype type 显示dwg1.txtren drive:pathfilename1 ren d:wg1.txt 将dwg1.txttree drive: tree 以树形结构显示dtree drive: tree d: copydrive:pathfilename copy d:1.txt 将d盘下的1.txt文到excopydrive:pathfilename xcopy d:wg e:wg01 将d盘wg目录下的文件及子目录一同到e盘名
16、为wg01的目录下,不包括空目录(其中/s参数表目录和子目录,不包括空目录xcopydrive:pathfilename xcopy d:wg e:wg01 将d盘wg目录下的文件及子目录一同到e盘名为wg01的目录下,包括空目录(其中/s参数表示movedrive:pathfilename move d:1.txt 将d1.txteattrib+R|-R+A|-A+S|-S| -H +I | -attrib +r attrib+R|-R+A|-A+S|-S| -H +I | -attrib -r 将e1.txt172.18.1.2 -n 2 -w 每隔2ms172.18.1.2attrib+R|-R+A|-A+S|-S| -H +I | -attrib +r attrib+R|-R+A|-A+S|-S| -H +I | -attrib -r 将e1.txt172.18.1.2 -n 2 -w 每隔2ms172.18.1.2path=%path%;C:Program Server 的bin目录添加到环境变量DOSwindowsnet net tom123 新建一个tom用户为net net localgroup Administrators tom tomAdministratorsnet net us
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2027年咸宁市高三二诊模拟考试物理试卷(含答案解析)
- 2027届焦作市高三下第一次测试物理试题(含答案解析)
- 盛夏农药喷施安全操作课件
- 2026年北师大版小学三年级数学上册第六单元《乘法》评价方案教案
- 妊娠期高血压疾病的护理
- 广东省广州市白云区2024-2025学年九年级上学期期末历史试题(含答案)
- 新生儿脑出血外科治疗
- 数据基础及结构 2
- LED显示屏安装工程基本培训
- IPAD指南解读之镇静剂选择
- 2026年水利工程安全与质量控制题库及答案
- 霍尼韦尔Forge平台战略竞争力分析市场调研报告
- 雨课堂学堂在线学堂云《人工智能与创新(南开)》单元测试考核答案
- 2026上半年四川成都职业技术学院编制外(考试)招聘30人笔试参考试题及答案解析
- GA/T 2336-2025法医临床学人体体表损伤检验规范
- 2025年汇能控股集团有限公司卓正煤化工招聘144人备考题库及一套参考答案详解
- 建筑修缮考试题库及答案
- 湖北邮政集团招聘笔试题库2026
- 孕期检查注意事项课件
- 无人机测绘操控员岗前评优竞赛考核试卷含答案
- 2025年山西二级造价师土建工程真题及答案解析
评论
0/150
提交评论