实验训练4:数据库系统维护.docx
实验训练4:数据库系统维护1.数据库安全性【实验6-1】建立账户:创建一个用户名为"Teacher,密码为T99999'的用户;创建一个 用户名为'Student'密码为"Slllir的用户。Details ror account newusepw。Login Account Limits Adminstrative Roles Schema PrivilegesLogin Name: TeacherYou may aeate multiple accounts with the same name to connect from different hosts.Authentication Type: Standardv*For the standard password and/or host based authentication, select 'Standard.Limit to Hosts Matdiing: | % and _ wildcards may be usedPassword:Weak password.Type a password to reset it.Confirm Password: "»*工Enter password again to confirm.Expire PasswordDetails for account Teacher)%Login Accouit Limits Administrative Roles Schema PriviegesLogin Name:StudentYou may create multiple accounts with the same name to connect from different hosts.Authentication T ype:StandardFor the standard password and/or host based authenticat)on, select Standard.Limit to Hosts Matching: % and _ wildcards may be usedPassword:产*Weak password.Confirm Password:Typea password to reset it.Enter password again to confirm.Expre PasswordUserFrom HostStudent%Teacher%mysql.sessionlocalhostmysql.syslocalhostrootlocalhostSchemashoppingPrivieges SELECT<Login Account Limits Admnstrative Roles Schema PrivilegesUserStudentFrom Host %Teacher%mysql.sessionlocalhostmysql.syslocalhostrootlocalhostUser AcccwntsUserFrom HostStudent%Teacher%mysql.sessionlocalhostmysql.syslocalhostrootlocalhost【实验 6-2用户授权:将 Shopping 数据库上 SELECT. INSERT. DELETE. UPDATE的权限授予'Teacher'用户:将Shopping数据库上SELECT的权限授予'Student'用户。Schema and Host fields may use % and _ wildcards.The server wi match specific entries before widcarded ones.Details for acccxint Teacher%Login Account Lmts AdmostraOve Roles Schema PrivilegesSchemaPrivlegesShoppyDELETE, INSERT, SELECT, UPDATESchema and Host fields may use % and _ wildcards.The server wil match specific entries before widcarded ones.Object Rights SaECT INSKTDOC Rights CREATE ALIW【实验6-3】以'Teacher'用户身份连接Shopping数据库,分别执行SELECT、INSERT、 DELETE. UPDATE. CREATE操作,查看执行结果;以'Student'用户身份连接Shopping 数据库,执行SELECT、INSERT、DELETE. UPDATE操作,查看执行结果。TeacherSuccessfully made the MySQL connectionInformation related to this connection:Port: 3306User: TeacherSSL not enabledA successful MySQL connection was made with the parameters defined for this connection.DonWmt ,1%1皿回 1 select * from autoparts;ItGrid ) O a ra* Row,:I11 Ed»:星| 矗品 Expori/lmpoft:1Q| 俗| Wrap Cell Content: 交Apri Apnameimage Jink 1 magejink2 image Jnk3 Introduction is.sale old jxice Price Weight is gei风胎刷热刷刷刷刷胎的垫凤胎刷他挡轮雨脚雨雨雨雨轮抡脚挡抡雨蜘1-1 xxxxXXXXXXXXXXXXXXXXXXXXXXXXXXX 2222 xxxxXXXXXXxxxx xxx xxx xxx xxxx xxxx xxxx xxxx xxxx xxxx Xx *x xxxx xxx xxx *YXxxxx xxx xxxx xxx xxxx xxxx xxxx xxxx xxxx xxxx 2222 xxxx xxxxxxx XY*同胎刷垫刷刷刷刷胎般挡轮雨脚雨雨雨雨轮轮风胎刷他挡抡雨Bln2.33500.9810.98230.0010.9810.9810.9810.98310.98310.9810.002.33500.9810.981.33500.989.99230.00329.99329.994.991.33500.989.99 ? in.no查看备份文件 W【实验6-4使用mysqldump匚具对Shopping数据库进行备份,H。I a犷只。I 蜜 I 一 © 围 I DonlUmitinsert into clientkind values (,'教阳');Output:工:3:3:":3:P Action Output# Time Action51 14:48:04 insert into dientkmd values (6.教师)w V# I I WF I" I1 delete from clientkind where kid= |;Output : J Action OutputTime Action1 14:48:04 insert into clientkind values (6.教师)2 14:48:50 delete from dientkind where name=教师.3 14:50:17 delete from dientkind where kid= 5M M I F IXXVIBJI-sni umn I R I J LUJ1 update clientkind set name ='教井T' where kid = t;|Output:J Action Output#TimeActionMe*e114:48:04insert into clientkind values (6.教师)1 ro,O214:48:50deJete from clientkind where name" 教师*EnoQ314:50:17delete from clientkind where kid= 51 fO)e414:50:57update dentkind set name =教师 T where kid = 61 ro,【实验6-5】对Shopping数据库启用二进制日志,并且查看日志。Successfully made the MySQL connectionInformation related to this connection:Port: 3306User: StudentSSL not enabledA successful MySQL connection was made with the parameters defined for this connection.【实验6-6使用mysqldump工具对Shopping数据库进行恢复,查看恢复前后Shopping数 据库的数据状态。Query 1 x01伊仔艮Ol酊I甯I Dont Limit1 select * from client;5100101xxxx XXX xxxx xxxxXXXX xxxxx张李丰-子龙人 五木子树CYS1 王李赵周IUC皿123456zs126,com2019-01-0100:00:0012322213344765432018-02-0100:00:002WW234523452017-09-08 00:00:003233333333332019-11-1100:00:0011122222222019-02-03 00:00:002222222222222019-02-03 00:00:0013211112019-11-30 21:31:442nnn函sI;E«I;LU«Result Grid 超0 Filter Rows:| Ed>:掰)愚 §n Export/Import:电:fQ Wrapdd ImageCname Password phone_numberEmailCreate timeCkind【实验 6-7分别使用 SELECT .INTO> MySQL 命令、MySQL Workbench 完成 Shopping 数据库中会员表和汽车配件表的导出,查看导出结果。T Y V in IV V 191 I 3nt5* insert into clientkind v«lues( /学生,);OutputJ Action OutputTimai 145n3Action sded -fromckrt7fow4i|fetiMnedO 2 1453:34&TorCode 1142 INSERTocmnanddenedtou>er *Sbudert'locAo*'forUble cienttand'W VZ i IIdelete fro« clientkind where cid »Output(5 Aden Output. Tbne AcwiQ 1 14:52:33 sdect 'fromderto 2 14 5334 mertm-rtk 必*M<5.亨生)O 3 1454.11 de4e<e from dentknd where cxl-67row8) ncUfnedEmxCodt 1142 2S£RT 8HEnorCode 1142 DELETE comand dened to u«r ,Sluiert eV>cdhoif for t4Ue cAerdund'实验 6-8】分别使用 LOAD DATA、MySQUMPORT、MySQL Workbench 完成 Shopping 数据库中 会员表和汽车配件表的导入,查看导入结果。0“ r ao iwio o h 力 i - a nj 31 update clientkiftd set 学生kid "Output(5 AcbonCktpU. Time Actiono 1 14 52 33 »4ec«-fromcier<O 2 145334 med rto c*ertknl v«be5,T±')O3 14 54 11 deHe from denied whw od 6O4 14 5516 updMe cWrtknd Mt zme 学生 T where kij 17rowgumedEnor Code 1142 INSERT axwnand derwd Io umt 3udentfor latte cSertkWEnot Code 1142 DELETE «mnod to ger SudMV)c- for l收 denfcmd'Enor Code 1142 UPDATE cvMnd deried to user Student'1ocaho«, lor Ubie JtW