精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 網(wǎng)絡(luò)知識(shí) > 網(wǎng)絡(luò)技術(shù) >

      ASP數(shù)據(jù)庫(kù)被掛馬怎么解決

      時(shí)間: 加城1195 分享

        數(shù)據(jù)庫(kù)掛馬應(yīng)該有用戶(hù)遇到過(guò),而且很多人都不知道怎么處理,在這里,小編講下ASP數(shù)據(jù)庫(kù)被掛馬的編程處理方法,你可以試用下,對(duì)你是否有幫助.

        方法步驟

        第一步:為現(xiàn)有數(shù)據(jù)庫(kù)做好備份。

        第二步:執(zhí)行如下ASP文件,這樣就可以去掉數(shù)據(jù)庫(kù)當(dāng)中的JS木馬:

        注:conn.asp自己去寫(xiě)了。

        ’這里放入JS木馬內(nèi)容:請(qǐng)記得改為自己數(shù)據(jù)庫(kù)中的JS木馬內(nèi)容。

        如果數(shù)據(jù)庫(kù)表很多的話(huà),上面的遍歷數(shù)據(jù)庫(kù)結(jié)構(gòu)未執(zhí)行完就被IIS給停止了。在這時(shí)候可以在:

        If rstSchema("TABLE_TYPE")="TABLE" Then

        當(dāng)中適當(dāng)加入k值的范圍,如:

        If rstSchema("TABLE_TYPE")="TABLE" k>10 and k<20 Then

        這樣的話(huà)就一次只操作9個(gè)表。

        第三步:

        根據(jù)數(shù)據(jù)庫(kù)JS注入的特性(會(huì)包括和http://這樣的字符),在conn.asp里面放入如下代碼:

        Function Cheack_Sqljs()’防止數(shù)據(jù)庫(kù)外鏈JS注入:true為發(fā)現(xiàn)外鏈JS注入。

        Dim F_Post,F_Get

        Cheack_Sqljs=False

        If Request.Form<>"" Then’表單提交時(shí)的檢測(cè)For Each F_Post In Request.Form If (Instr(LCase(Request.Form(F_Post)),"0 or Instr(LCase(Request.Form(F_Post)),"")<>0) and Instr(LCase(Request.Form(F_Post)),"http://")<>0 Then

        Cheack_Sqljs=True

        Exit For

        End If

        Next

        End If

        If Request.QueryString<>"" Then’QueryString提交時(shí)的檢測(cè)For Each F_Get In Request.QueryString If (Instr(LCase(Request.Form(F_Get)),"0 or Instr(LCase(Request.Form(F_Get)),"")<>0) and Instr(LCase(Request.Form(F_Get)),"http://")<>0 Then

        Cheack_Sqljs=True

        Exit For

        End If

        Next

        End If

        End Function

        Function CheckDataFrom()’檢查提交數(shù)據(jù)來(lái)源:True為數(shù)據(jù)從站外提交過(guò)來(lái)的

        CheckDataFrom=True

        server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) if mid(server_v1,8,len(server_v2))<>server_v2 then

        CheckDataFrom=False

        end if

        End Function

        If Cheack_Sqljs or CheckDataFrom Then

        Response.Write "" Response.End()

        End If

        一般是數(shù)據(jù)庫(kù)里有一張表里的內(nèi)容有 讀取數(shù)據(jù)庫(kù)或服務(wù)器的代碼,造成的,用管理數(shù)據(jù)庫(kù)軟件連接,刪除表里的記錄。

        補(bǔ)充:MySQL 數(shù)據(jù)庫(kù)常用命令

        create database name; 創(chuàng)建數(shù)據(jù)庫(kù)

        use databasename; 進(jìn)入數(shù)據(jù)庫(kù)

        drop database name 直接刪除數(shù)據(jù)庫(kù),不提醒

        show tables; 顯示表

        describe tablename; 查看表的結(jié)構(gòu)

        select 中加上distinct去除重復(fù)字段

        mysqladmin drop databasename 刪除數(shù)據(jù)庫(kù)前,有提示。

        顯示當(dāng)前mysql版本和當(dāng)前日期

        select version(),current_date;

        數(shù)據(jù)庫(kù)維護(hù)方法

        在MySQL使用的過(guò)程中,在系統(tǒng)運(yùn)行一段時(shí)間后,可能會(huì)產(chǎn)生碎片,造成空間的浪費(fèi),所以有必要定期的對(duì)MySQL進(jìn)行碎片整理。

        當(dāng)刪除id=2的記錄時(shí)候,發(fā)生的現(xiàn)象

        這個(gè)時(shí)候發(fā)現(xiàn)磁盤(pán)的空間并沒(méi)有減少。這種現(xiàn)象就叫做碎片化(有一部分的磁盤(pán)空間在數(shù)據(jù)刪除以后(空),還是無(wú)法被操作系統(tǒng)所使用。)

        常見(jiàn)的優(yōu)化:

        # alter table xxx engine myisam;

        # optimize table t1;

        注意: 在實(shí)際開(kāi)發(fā)的過(guò)程中,上面兩個(gè)語(yǔ)句盡量少使用,因?yàn)樵谑褂玫倪^(guò)程中,MySQL的表的結(jié)構(gòu)會(huì)整體全部重新整理,需要消耗很多的資源,建議在凌晨?jī)扇c(diǎn)鐘的時(shí)候執(zhí)行。(在linux下有定時(shí)器腳本可以執(zhí)行,crontab)


      數(shù)據(jù)庫(kù)相關(guān)文章:

      1.怎么開(kāi)啟SQL數(shù)據(jù)庫(kù)服務(wù)

      2.sql數(shù)據(jù)庫(kù)的集合函數(shù)查詢(xún)

      3.excel怎么將表格連入數(shù)據(jù)庫(kù)

      4.把Excel數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫(kù)的方法

      5.數(shù)據(jù)庫(kù)中default的用法

      4014886