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 "ת»»Òì³£";}
}
Ïà¹ØÎĵµ£º
¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW())&nbs ......
Îȹʶø֪У¬×î½üÓÖÓõ½ÁË£¬²Ý²ÝÄÃÀ´ÎÂϰһϣº×ª×Ô http://www.bccn.net/Article/sjk/mysql/jc/200601/3411.html
MySQL¹ÜÀíÔ±Ó¦¸ÃÖªµÀÈçºÎÉèÖÃMySQLÓû§Õ˺ţ¬Ö¸³öÄĸöÓû§¿ÉÒÔÁ¬½Ó·þÎñÆ÷£¬´ÓÄÄÀïÁ¬½Ó£¬Á¬½ÓºóÄÜ×öʲô¡£MySQL
3.22.11¿ªÊ¼ÒýÈëÁ½ÌõÓï¾äʹµÃÕâÏ×÷¸üÈÝÒ××ö£ºGRANTÓï¾ä´´½¨MySQLÓû§²¢Ö¸¶¨ÆäȨÏÞ£¬¶øREV ......
LAST_INSERT_ID
×Ô¶¯·µ»Ø×îºóÒ»¸ö INSERT »ò UPDATE ²Ù×÷Ϊ AUTO_INCREMENT ÁÐÉèÖõĵÚÒ»¸ö·¢ÉúµÄÖµ. ²Î¿¼ÕâÀï
The ID that was generated is maintained in the server on a per-connection basis.
LAST_INSERT_IDÊÇ»ùÓÚµ¥¸öconnectionµÄ, ²»¿ÉÄܱ»ÆäËüµÄ¿Í»§¶ËÁ¬½Ó¸Ä±ä¡£
¿ÉÒÔÓà SELECT LAST_INSERT_ID(); ²éѯLAST ......
1. Í£µ½ÔËÐеÄmysql: /etc/init.d/mysql stop
2. ʹÓÃskip-grant-tablesÕâ¸öÑ¡ÏîÆô¶¯MySQL£º /usr/bin/mysqld_safe --skip-grant-tables &
3. ÏÖÔÚ¿ÉÒÔ²»ÓÃÃÜÂë½øÈëmysql ÁË¡£
# myql
>   ......
¡¡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.µ¼³öÒ»¸öÊý¾Ý¿â½á¹¹
¡ ......