mysqlÖÐÎÄÂÒÂëÎÊÌâµÄ½â¾ö·½·¨£¬¾Êµ¼Ê¼ìÑé¿ÉÒÔÓõÄ
ÍøÉϵĽâ¾ö·½·¨´ó¶àÊÇÒªÐÞ¸ÄmysqlÅäÖÃÎļþ£¬¶ÔÎÒÃDz»Êʺϡ£jhostÖ÷Ò³ÉÏ¿´µ½ÆªÎÄÕ£¬µ«ÀïÃæËµµÄÇý¶¯Ôç¾ÍÊÇÀÏÇý¶¯ÁË£¬»³ÒÉËûÊÇ´ÓÍøÉϸ´ÖƹýÀ´µÄÀϰ汾£¬²»ÖªÊÇ·ñÄÜÓá£ÏÖÔÚ°ÑÎÒ×Ô¼ºµÄ½â¾ö·½°¸Ìù³öÀ´£¬¹©´ó¼Ò²Î¿¼£¬»¶ÓÅúÆÀÖ¸Õý¡£
´ó¼Ò×¢ÒâºìÉ«²¿·Ö£¬·Ï»°²»¶à˵£º
µÚÒ»²½£ºÍøÒ³Í·ÉèÖãº
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*" %>
µÚ¶þ²½£ºrequestÉèÖãº
<%
request.setCharacterEncoding("gbk");
%>
µÚÈý²½£ºbeanÖÐÁ¬½Ómysql´úÂëÉèÖãº
MySqldriver = "com.mysql.jdbc.Driver";
MySqlURL = "jdbc:mysql://";
MySqlURL =MySqlURL+server+":"+port+"/"+dbname+"?user="+user+"&password="+pass+"&useUnicode=true&characterEncoding=utf8";
µÚËIJ½£º
ºº×Ö´æÈë֮ǰÏÈg2i£¬È¡³öºº×ÖÖ®ºóÏÈi2gת»»£¬È»ºó¾Í¿ÉÒÔÔÚjspÒ³ÃæÉÏÕýÈ·ÏÔʾÁË
ÆäÖÐg2iº¯ÊýºÍi2gº¯Êý·Ö±ðÈçÏ£º
public static String g2i(String s0){
try{
return new String(s0.getBytes(),"ISO-8859-1");
}catch(Exception e){
return "ת»»Òì³£";}
}
public static String i2g(String s0){
try{
return new String(s0.getBytes("ISO-8859-1"),"gb2312");
}catch(Exception e){
return "ת»»Òì³£";}
}
Ïà¹ØÎĵµ£º
¶¨ÒåÓαê
DECLARE cur_Ãû³Æ CURSOR
FOR
SELECT ×Ö¶Î1,×Ö¶Î2,...×Ö¶În from ±í where ×Ö¶Î1=±äÁ¿;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET ±äÁ¿1=null,±äÁ¿2=null;
OPEN cur_Ãû³Æ;
FETCH cur_Ãû³Æ INTO ±äÁ¿1,±äÁ¿2...;
WHILE ( ±äÁ¿1 IS NOT NULL) DO
&nbs ......
ÏÈ¿´ÏÂÃæ×¢ÒâÄÚÈÝ
ÕûÕûŪÁËÒ»Ì죬ÖÕÓÚ½â¾öÁËjdbc(mysql-connector-java-5.0.30)ºÍmysqͨÐÅÖÐÎÄÂÒÂëµÄÎÊÌ⣡ÎÒµÄϵͳÊÇ
linux£¨ubuntu£©¡£ÔÚjavaÖУ¨Myeclipse»·¾³£©Ê¹ÓÃhibernateÁ¬½Ómysql¡£´æ´¢Ó¢ÎÄûÎÊÌ⣬д£¨insert
into£©ºÍ¶Á£¨select£©¶¼ÄÜÕýÈ·ÏÔʾ£¬µ«ÊÇÈôÆäÖдøÓÐÖÐÎÄ×Ö·û¾Í³ÉÂÒÂëÁË¡£µ½ÍøÉϲéÕÒÁ˰ëÌì×ÊÁ ......
Ò»´ÎNginx+PHP+MysqlµÄ²¢·¢²âÊÔ¾Àú
Ò»¡¢Ó²¼þ»·¾³
CPU:4ºËIntel(R) Xeon(R) CPU E5504 @ 2.00GHz
6GÄڴ棬120GÓ²ÅÌ
¶þ¡¢Èí¼þ»·¾³
L ......
1. Mysql Åàѵ
1.1. ÅàѵĿµÄ
±¾ÎĵµÊÇÕë¶ÔMySQL Êý¾Ý¿â·½ÃæµÄ»ù´¡Åàѵ£¬ÎªÁËʹÏîÄ¿×é³ÉÔ±Äܹ»´ïµ½Ê¹ÓÃMySQL Êý¾Ý¿âµÄÄ¿µÄ¡£
1.2. Åàѵ¶ÔÏó
¿ª·¢ÈËÔ±
1.3. ³£Óôʼ°·ûºÅ˵Ã÷
³£Óôʣº
Mysql£ºÒ»ÖÖÃâ·ÑµÄ¿çƽ̨µÄÊý¾Ý¿âϵͳ
E:\mysql£º±íʾÊÇÔÚdos ÃüÁî´°¿ÚÏÂÃæ
mysql> ±íʾÊÇÔÚmysql µÄÃüÁîÐÐÏÂ
1.4 ......
¡¡1.µ¼³öÕû¸öÊý¾Ý¿â
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
¡¡¡¡2.µ¼³öÒ»¸ö±í
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
¡¡¡¡3.µ¼³öÒ»¸öÊý¾Ý¿â½á¹¹
¡ ......