http://w" />
  首页  »   PHP

蹇冩儕鑳嗘垬-浣跨敤phpmyadmin鎭㈠璇垹闄ょ殑鏁版嵁

网友分享于:2013-11-22  浏览:0次
蹇冩儕鑳嗘垬--浣跨敤phpmyadmin鎭㈠璇垹闄ょ殑鏁版嵁

璇濊浠婂ぉ鎶介瑙侀浜嗭紝鏈€杩戞鍦ㄧ揣閿e瘑榧撳湴鍋氱編濂虫槑鏄熷浘鐗囧ぇ鍏?a href="http://www.meimei199.com/star/">http://www.meimei199.com/star/缃戠珯锛屼竴涓嶅皬蹇冩妸鏁翠釜绔欑偣鍒犻櫎浜嗭紝5555锛岄噷闈㈡€诲叡鏈?涓猼鐨勬枃浠跺晩銆傘€傘€傘€傝繕鏈夋湁澶囦唤锛屽彧鑳芥參鎱㈠湴鍊掑洖鍘讳簡锛岀湅浜嗛璁?涓ぜ鎷滐紝鏈夌偣鎯虫墦浜虹殑鍐插姩锛屼笉杩囪繕濂斤紝鍙笉杩囨暟鎹簱涔熻鎴戝垹闄や簡锛屽搸銆傘€傘€傝ˉ鏁戝惂

鏃犲涔嬩笅锛実oogle锛屽彂鐜版湁涓嶅皯浜轰篃鏈夊儚鎴戜竴鏍风姱鍌荤殑涓€鍥烇紝浣嗘槸鍑犱箮娌℃湁鐪嬪埌鍏蜂綋鐨勮В鍐虫柟娉曪紙鏈夎鐢ㄧ‖鐩樿蒋浠舵壘鍥烇紝涔熸湁璇寸敤浜岃繘鍒舵枃浠舵壘鍥烇級锛屼絾鏄垜鏈韩瀵规湇鍔″櫒涓嶅ぇ鎳傦紝瑙夊緱濂界籂缁擄紝閭h竟鍙堝湪鍌鏁版嵁鎬庝箞娌℃湁浜嗭紝杩樿涓€瀹氬緱鎵惧洖鏉ャ€?br>杩欎笅鎴戞洿鎬ヤ簡锛屾櫄楗兘娌″績鎯呭悆銆?br>聽
杩欐椂锛屾垜鎵惧埌浜嗕竴浜涗笓闂ㄥ府浜烘仮澶嶆暟鎹殑鎶€鏈汉鍛樸€?br>浠栭棶浜嗘垜鏁版嵁閲忥紝鏁版嵁搴撳紩鎿庯紝褰撴垜璇存槸鈥榤yisam鈥欐椂锛屼粬鏉ヤ簡鍙ワ細閭f棤瑙d簡銆傘€?br>褰撴椂鎴戜竴涓嬪瓙鎳典簡銆?br>聽
鎯呮€ヤ箣涓嬶紝鎴戞兂鍒颁簡锛屼箣鍓嶅湪testing鏈嶅姟鍣ㄩ噷闈㈡湁涓€涓壇鏈暟鎹簱锛屼絾鏄偅閲岀殑鏁版嵁宸茬粡鏈変簺鏃舵棩浜嗭紝鏍规湰娌℃湁鏈€鏂颁竴涓湀鐨勬暟鎹€?br>杩欐牴鏈棤娉曡В鏁戞垜锛?br>聽
杩欓噷鎴戝湪phpmyadmin涓湅鍒颁簡杩欎釜锛?/p>

鑴戦噷鍑烘潵浜唃oogle涓婅鐨勭敤浜岃繘鍒舵仮澶嶏紝灏辩偣寮€鐪嬩竴涓嬨€傜粨鏋滃ぇ鍠滐紒OMG锛屾湇鍔″櫒寮€閫氫簡鏃ュ織锛?/p>


閲岄潰鏈夋暟鎹簱鐨勬搷浣滄棩蹇楋紝鑰屼笖杩樻槸sql鏍煎紡鐨勶紒锛侊紒
鎴戜箣鍓嶆病鏈夋帴瑙﹁繃杩欎釜涓滆タ锛屼絾杩欐椂瀹冨氨鏄垜鐨勬晳鍛界ɑ鑽夈€?br>鎴戞祻瑙堜簡涓€涓嬶紝閲岄潰鏈夎繎涓€涓湀鐨勬洿鏂拌褰曪紝宸茬粡瓒冲浜嗐€備笉杩囨湁涓€涓棶棰橈紝鍦╬hpmyadmin閲岄潰鐪嬶紝鍙兘鏄剧ず鍏朵腑涓€灏忛儴浠藉唴瀹癸紝闈㈠10鍑爓鐨勬暟鎹锛屾兂瑕佷竴涓釜鎵惧嚭琚垹琛ㄧ殑鏁版嵁锛屽お闅句簡銆?br>聽
杩欐椂锛屾垜鎯冲埌浜嗗彲浠ヤ粠鏈嶅姟鍣ㄤ腑涓嬭浇杩欎簺鏂囦欢锛岀劧鍚庡緱鍒板叾涓殑鏁版嵁銆?br>璇村共灏卞共锛屾垜鐧诲綍鏈嶅姟鍣紝鎼滅储杩欎簺浜岃繘鍒舵枃浠讹細


涓婂浘涓孩鍦堢殑灏辨槸浜?br>聽
鐒跺悗灏嗚繖浜涙枃浠朵竴涓釜瀵煎嚭鎴愬彲浠ラ槄璇荤殑sql锛?/p>


杩欐牱灏嗚繖浜涗簩杩涘埗鏂囦欢涓€涓釜杈撳嚭鎴愪簡姝e父鐨剆ql鏂囦欢銆?br>聽
杩欐椂锛屽氨鏄浠庤繖浜涙枃浠朵腑鎵惧埌琚垹琛ㄧ浉鍏崇殑鏁版嵁浜嗭紝浜庢槸鎴戝啓浜嗕釜java绋嬪簭甯垜鍋氳繖涓簨鎯咃細
[java] view plain copy
package com.nerve.sql.reload;聽
聽聽
import java.io.BufferedReader;聽
import java.io.BufferedWriter;聽
import java.io.FileReader;聽
import java.io.FileWriter;聽
import java.util.ArrayList;聽
import java.util.List;聽
聽聽
import org.nerve.util.NumberUtil;聽
聽聽
/**
聽* @project: cloudOffice_swing
聽* @file: ReloadWorker.java
聽* @package: com.nerve.sql.reload
聽* @description:
聽*聽聽聽 灏嗕簩杩涘埗鏃ュ織瀵煎嚭鐨勬枃浠朵腑鐩稿簲琛ㄧ殑鎿嶄綔璁板綍鎻愬嚭鍑烘潵
聽* @author:聽http://www.meimei199.com
聽* @date&time: Jan 23, 2014
聽* @change log:
聽*/聽
public class ReloadWorker {聽
聽聽聽聽聽
聽聽聽 public void read(List<String> orgF, String targetF, String table) throws Exception{聽
聽聽聽聽聽聽聽 BufferedWriter bw = new BufferedWriter(new FileWriter(targetF, true));聽
聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 for(String or:orgF){聽
聽聽聽聽聽聽聽聽聽聽聽 BufferedReader br = new BufferedReader(new FileReader(or));聽
聽聽聽聽聽聽聽聽聽聽聽 String t = null;聽
聽聽聽聽聽聽聽聽聽聽聽 String t2 = null;聽
聽聽聽聽聽聽聽聽聽聽聽 table = table.toUpperCase();聽
聽聽聽聽聽聽聽聽聽聽聽 while((t=br.readLine())!=null){聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 t2 = t.toUpperCase();聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 /*
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 * 濡傛灉鏄痷pdate鎿嶄綔锛岀洿鎺ユ彁鍑?
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 */聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if(t2.startsWith("UPDATE "+table)){聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 bw.append(t+";\n");聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 }聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 /*
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 *聽 濡傛灉鏄痠nsert璇彞锛屽洜涓烘湁涓€浜涙棫鏈嶅姟鍣ㄧ殑鏁版嵁
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 *聽 鎵€浠ヨ鍏堟墽琛宒elete鎿嶄綔
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 */聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 else if(t2.startsWith("INSERT INTO "+table)){聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 String ids = t2.substring(t2.lastIndexOf(","));聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 bw.append("delete from "+table+" where id="+NumberUtil.toDigital(ids)+";\n");聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 bw.append(t+";\n");聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 }聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 /*
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 * sql璇彞鍚庨潰閮借鍔?; 锛屽洜涓哄師鏉ユ病鏈夛紝涓嶅姞鐨勮瘽锛屽湪瀵煎叆鍒版暟鎹簱鏃讹紝鍑洪敊
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 */聽
聽聽聽聽聽聽聽聽聽聽聽 }聽
聽聽聽聽聽聽聽聽聽聽聽 br.close();聽
聽聽聽聽聽聽聽 }聽
聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 bw.flush();聽
聽聽聽聽聽聽聽 bw.close();聽
聽聽聽 }聽
聽聽聽聽聽
聽聽聽 public static void main(String[] args) throws Exception{聽
聽聽聽聽聽聽聽 long sd = System.currentTimeMillis();聽
聽聽聽聽聽聽聽 ReloadWorker w = new ReloadWorker();聽
聽聽聽聽聽聽聽 List<String> orgs = new ArrayList<String>();聽
聽聽聽聽聽聽聽 orgs.add("C:/Users/IBM_ADMIN/Desktop/000015.txt");聽
聽聽聽聽聽聽聽 orgs.add("C:/Users/IBM_ADMIN/Desktop/000016.txt");聽
聽聽聽聽聽聽聽 orgs.add("C:/Users/IBM_ADMIN/Desktop/000017.txt");聽
聽聽聽聽聽聽聽 orgs.add("C:/Users/IBM_ADMIN/Desktop/000018.txt");聽
聽聽聽聽聽聽聽 orgs.add("C:/Users/IBM_ADMIN/Desktop/000019.txt");聽
聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 String targetS = "C:/Users/IBM_ADMIN/Desktop/000017_sql.txt";聽
聽聽聽聽聽聽聽 w.read(orgs, targetS, "task");聽
聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 System.out.println("DONE, on " +(System.currentTimeMillis() - sd)/1000+" s");聽
聽聽聽 }聽
}聽
銆€銆€
寰楀埌浜嗘眹鎬荤殑sql鏂囦欢鍚庯紝灏卞鍏ュ埌鏁版嵁搴撲腑銆?br>鏈€鍚庯紝鎴愬姛

棰濄€傘€傘€傛彁閱掑ぇ瀹?/p>

璁哄浠界殑閲嶈鎬?/p>

璁哄浠界殑閲嶈鎬?/p>

璁哄浠界殑閲嶈鎬?/p>

銆傘€傘€傘€傘€?/p>

相关解决方案

最新解决方案