在Uni下实现数据库的操作

上传人:jin****ng 文档编号:118400557 上传时间:2022-07-11 格式:DOCX 页数:7 大小:244.55KB
返回 下载 相关 举报
在Uni下实现数据库的操作_第1页
第1页 / 共7页
在Uni下实现数据库的操作_第2页
第2页 / 共7页
在Uni下实现数据库的操作_第3页
第3页 / 共7页
亲,该文档总共7页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
实验序号:5实验报告五、六实验项目名称:在Unix下实现数据库的操作学号姓名潘欢专业、班信管1003实验地点指导教师时间2012-12-12、实验目的及要求1在FreeBSD下安装配置数据库;2分别用JavaSE和jsp在UNIX下实现简单的数据库操作;二、实验设备环境及要求Windows7VMware三、实验内容(1) 在Unix下实现数据库的操作,如mysql(2) 用JavaSE操作数据库,至少分别插入、修改、删除、查询一条记录(3) 用jsp或php操作数据库,至少分别插入、修改、删除、查询一条记录四、四、实验结果(1)首先,配置好网络环境;安装数据库MySQL第一步:加载镜像文件;第二步:使用Sysinstall命令;第三步:选择Ue1conetu1heFreeBSDinstilionandcunrlomtool.PleaseselpctnnenfthpnplinnsliRlnubythearrrwnringfliptiretrharartfrdTthenplinmbamfiyaurpimteirpteriin.nunkprmotfarMittiSPACEorLfNTEH.Toexit,useL1RB1toiwqtoExit.sagetondardlxpressDustDl*lQuickDeqinB出qiri血匕iIIsiart一HomtausefliishbtiusystenastavkdardinstaLlotion(reconnendedl)aquticlkinstallaiion(forexperts)acusloninsta1laiionCforexjjerls)Inposl-1nstn11confignralloiofFreRSIirptionsixitpgradcodConfig.vidtsxIrstdL1lationInstmid:inns,REAUME,匚.iectkeyboardtUiOH/SotionsinstaLlaiionoptionsRepairModsuithCDROM/DUBfloppjjiorstartshol1UpgradeexistlugsestonLonddefanitInstallconfigurationG】u鼻歸nryLiffuiiLIeJertXEvitInstilILFreeBSDCunfiguraIfyouvealreadyinsta1ledFreeBSD,younayusethisMenutocustoMizeitsnMRwhattosuitpnurparticiilarconfigurationMostinportanl1yencaniisathePackagpsutilitytoloadpxtraM3rdpartysoftuarenotprouidedinthebasedistributionsationinstallationExitDistributionshordFdiskLabelUsorNanageMontConsoleTine2oncNediaHouseInstalletTheThAdd(returningtoprevious)additiona1distributi”seisFrEeDSDDocunentationsetspstewnaiidger*spasswordthediskSlice(PC-stilepartitton)EditordiskuserandgroupLabeleditorinfornatior)lobohauiorCustoMizosystoHconsoSetnhichtinczoneyoureinChangetheinstallationMediatpeCunfiuureyournuuse|iThi小!Ii11ProtsFlforMore:ntoTMationothe”BptionsZSZES3StuitandSPACE.beuiiMdrkeilordeleted(IfInstalled).IfthepaukayeisTunarkapackaye,nuvedlreadpnarked,ith111IteMSMarkeduttha*D*aredependencieswhich1】beauto-loaded.TosearchforapackagepressRETURNNUTE:subMonuTbynaMP,pressESC.Toselectacategory,ThpA11categoryselectioncreatesauorilargeIfyousolodit,ploasobopationtuhiloitcohosup.RInstal1atabasosoftnaro.evelnsncxUariousDesktoputilities、SoftwaredevelopMeirtuti1itiesand1ibrariesDunainNoneServicetoolsrtRta-portsforFreRBSDflociiMeDtat.Ionccesbibi1ityrebiversstroiidinOHMSonvortors+abasosiA11availoblepackagesinal1categories.Portstolielpdisabledusers.Ulilitissfurarchivingandunarchivinydata.Applledt.ionsrelatRiltoastronomyAudiouti111ips-MostrpqiilrpasuppnrtRrtsoundcardCoMMiinicationsuti1itiesForMalconvorsionu1i1itios.iTa111hroctdodSULdciiaruaiilcclThesearethepackaIfyunresurenfthesechuices,sele匚IDR.Ifnut.selectCatices1iuguhoLC*tath巴packoyesele匚ticriir-teiiu.安装成功,初始数据库./mysql_install_db-basedir=/usr/local-datadir=/var/db/mysql/FLEhSEtEKEHBEnTOSITHpnSUntDFORTHKrootUSERfTnrtn肴n*start1hFtsurwrtheniRKiin4bfifnIlouin(jcniHnwiiidl:kusrlocalb1ladMir-nrootpassnord4ikeiri-jiassihiord9kusrlucdlb1nHcilcidHlri-nrout-hpeSHurd4iieH-paHordqHlIurnclIi*uuuanrun:rusrlutialtiiqiiLihichwillfillsaijiuv?th巳口pti口nofirennvincj1the+esitpatabasesandanonMoususer亡reairedbydefau11.lhisiisstrong1jirecoriMendedforproductloimserverskoctbMammo1fnrMnrnIinstructlnns4卜qucanstartttioMSQLdaemonMlth;pdusrzlocd1;;IocaJzbinMsqid_sare&ralPtimth占ttJimdfsilfriLJiiutil1-1-yait=runp1cdZubrZiuiiLflLsq1-Iwet;pur1-run.plFlenreprrtnmppirohImithtlieZiasirZI口I爾ciri卩十耳/討斗jsq1hniif|scri|tTflitornatlue1ycanrun:kusrlocalb1lwSGCtirw_lnstdlJationUhichMillalcigluujuutoptlmiufreHuulnIlitestHaanildiiimiMou*営时itcrudlydbydofduLIThl営IkLtrunylyridcuiMMndtrdforpruiluctiuii耳bt*甘厂囂pww灯函Mdiiiud1fu-rMuryinstructlon.pouGd/nstarttlieMySQLdaoMonMith:bdloca1zusrLocaizbinyi:q1-1ost;pur11-tyi:t-run*pl】屠应rupurtd.nypzublt!Mwiththe/ur/ltiuaLicrIptsMjyqIbuyverIj#tfbl/*呷営i|吕uKwr1JldIddlr=uidliMxq1&Fl11206卜12121918:52:8IdsafeLaggiwigto11-mircUiZHsqLirjr121219185209网vqld.E我StartinyIddaoHonMitJid车t*bN宜hefroritt2121918:5209Miqld_safuh(|IdfroMpldfHe/umr/就b/nygq1/pldended后台启动服务器,在这里,要修改权限,./mysqld_safe-user=mysql-datadir=/var/db/mysql&因为没有赋予user=mysql,mysql的权限,所以出错。应该修改为./mysqld_safe-user=root-datadir=/var/db/mysql。AFgPcPgPcPe11yyld!atadLr-vardbnysq1MrusqId生血ft?MUsqIdiFflHpidlfIle/var/ribHys45risqId.FeLoygiimytovarUbziisqI/*irjrMLinIdfS+antinq1dldahiithdatah訐处杞盘imHXua-rdBZh1dendlRd*xnysqId=sciIuuser-Mjiibtj1distauir=Zvr/dlvardtiinvsijlHyrBciJl-user口光-datadIr=zvarxdbZMyisq1A1JDoneZnyq1ch口hthHr口七-/mysqiIdl_safe1 JISA31Z1219IS:89:S6ldHsgedt1ibexeczge11yj1lUUMUCZijJQitt.$JIibvxB匚f(j11y11tiPcReZfe+t|ji1ibexecfjBttjiltyu3IlyklIty5tti土3在UNIX下操作使用MySQL;1.mysqlSELECTVERSION。,CURRENT_DATE;mysqlSELECTVERSION。;SELECTN0W();ERRDHJ-IInkHnhiriiin.niIumfhcurrnnt_ri3EE5I-E551壬i1ni(.C11rT?rtf_!.t1E;干一.于1werk1ctn)*ci*rrnnt_dlntm4-+:21:2012-12-19!#VHS(lMMH吕1row1tiisetEp聲X3RIHQt101%(;SRIt11DidiC);.一-:1UiTif)!:弓.5u2丄:1rcM1TOtilrOB石x:”;-laZWiH411U1尸口t41iht2在mysqL下创建数据库phDB,在该数据下创建表phinfo,插入、更新和删除值。1nrpatepfiEB;QueryOK,1ronaffeciedC9.E1sec)h(j1pliDB;Databasechrnngedmjis(iIcrydlEVle|j)ihifu;KUMLH1113耳tablamisth去walleasl1co1KHnHysq1createtablepliInfo(xmchar(5Jrage)ntxlcJmr(29)J:UuferiClK,RTogdfrbcLhiil93mhh)LsqlinsertintophD9uaIwsIW.?亂T,LBe993B348MJ;FflUflB1146C*17SF21;TflblpPphnB.phnRInpsnRtexistttysq1incortintophlnfowaIncsCph11r20,Urt4figIi些芒!JTbforr-ta.t1lyi_sk_Jiui-4-aidm羔T*q1ttysq1incortintophlnfowaIncsCph11r20,Urt4figIi些芒!JTbforr-ta.t1lyi_sk_Jiui-4-aidm羔T*q1*tc-StZ口irpl|E3*OTtqff:drttlI口rlnidL匚珂IMnTIEEd阵*4口g*0t:qu1cvrra4-hr4upmJfHAAt:atiaiSCk-dlb&i-i|aril卜spy.与1liluiJHUSfl1!lU0OB3B34fl1);buervCK,1ionCLffeutil(0.03sec)wwqlselectfrotiiphInfo;卄=+XH;xh管-1ph;7FI41rcuinset(B.OBsec、nysq1EhyiQ1StilHUl*frurijjhlnfu;-4+_.-!KM:xh;n|-=+:pF);2B:;!px:日:10699(3Oi31L:;c#;in:iBFSFnnai;*=+=3row:inset(/BBsec)Hysq1updatepliInfosetajb-age*2:buerv1Ks3rokisaffectedC6iP32sec)RousMatcirnad:3Cliaimged:3Uarni:0耐列1select理frumgjInImfu;+-k=一+!xh:啊住!xhE+二;-卄ia+:ph:22:ldld9H348:px11:10GU0139J11:;cy:?0:1:*roHShywqlinsatJ(0r9Gsec)3.重新创建数据库is2012,在数据库里面创建表product。然后把testl.jsp加载到Tomcat服务器/usr/local/apa*/webapaps/ROOT下面。把连接驱动加载到/usr/local/apa*/lib挺口鼻r)dnf|忖口m.iiis7R12;readiTytableirformiiiarforconpletlonciftAuleicl-freinjjruducnoHCL:book:2 !pen!3 ;Tm11:1-LunnEcloijav*-ri.,1.22-bin.jarflcpI*ziisr/Iocain*IsImutstidp.Jat:ata1ini-tasks.xmIcato1ima,shrnHHons-daAMnn-rat1u4.tir.yzcoHMons-dacMon.jarcunfivlest$h血orwnrAdi,whp.xtflrtup.shLisimgLisimgGshiykJsirgLisimgpapacliE-tOMtat-7.A/bln/tOMcat一u】i.JafJtUNNIMG.IxtbinCunrloistebipHCbilppSHurksetcIdss虛1h占hshutdown、shstatup.shtnMFTiHt-jll11J*liisr/lacal/fti-sr1oca1/Apidche-toricat-70binbootwtirmpjarsusr/*1(匚411四、分析与讨论通过本次实验,掌握了在UNIX系统中连接使用数据库,并通过JSP操作数据库,搭建了B/S的网络结构。六、教师评语签名:日期:成绩
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!