Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysqlÂÒÂëÎÊÌâ

½â¾öMySqlÊý¾ÝÂÒÂë:
1 д¹ýÂËÆ÷ÉèÖñàÂë¸ñʽ(¸ñʽºÍJSPÒ³ÃæµÄ±àÂëÒ»Ñù)£¬»òÔòÔÚÇëÇóÀïÃæдrequest.setCharacterEncoding("±àÂ뷽ʽ");
2 Èç¹ûÊDzéѯ³öÊý¾ÝÂÒÂ룬ÔÚÁ´½ÓµÄURLÉϼÓÉϱàÂë¸ñʽ(ÄãÕâÀï¼ÓÁË£¬Ã»ÎÊÌâ);
3 ÐÞ¸Ämy.iniÎļþÀïÃæµÄ default-character-set= ÄúÒªµÄ±àÂë¸ñʽ (Ò»¹²ÓÐÁ½´¦£¬Äã²éÕÒһϠ¸ÄΪһÑùµÄ±àÂë¸ñʽ)
3 Èç¹ûÊÇдÈëµ½Êý¾Ý¿âÖ®ºóÊÇÂÒÂë(Ç°ÌáÊÇÒѾ­Ð´Á˹ýÂËÆ÷´¦Àí±àÂë),ÐÞ¸Ämy.iniÎļþÀïÃæ²éÕÒsql-mode ÉèÖà sql-mode = 
  "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
ÊÔÊÔ°É£¡
  ÕâÊÇËùÓÐÂÒÂëµÄÇé¿ö£¡ ÎÒÓõÄÊÇMYSQL5.0 ½â¾öÂÒÂë¾ÍÕâÑù¸ãµÄ£¡£¡£¡£¡£¡£¡£¡
Êý¾Ý¿â±àÂë²ÉÓÃUTF8£¬Í¬Ñù£¬ÐÞ¸ÄÁ¬½Ó×Ö·û´®Îª£ºjdbc:mysql://localhost:3306/BookDB?useUnicode=true&characterEncoding=utf8
½«ÄãµÄdefault-character-set=latin1 ¸Ä³Édefault-character-set=gbkÊÔÊÔ.
ÔÚ°²×°µÄʱºòÑ¡ÔñGBK¾Í¿ÉÒÔ.»òÕßÔÚMY.INIÀïÃæ¸ÄÒ²¿ÉÒÔ.
д¹ýÂËÆ÷ÉèÖñàÂë¸ñʽ¡£
»òÕßÊÇ°Ñ´ÓÊý¾Ý¿âÖжÁ³öµÄ×Ö·ûÏÈת³ÉbyteÊý×飬ÔÚ±àÂë³Éutf-8,±£Ö¤½â¾öÎÊÌâ
½â¾ö·½·¨:
ËùÓеıàÂ붼ʹÓÃÒ»ÖÖÈç:utf8
1.Êý¾Ý¿â±àÂë:
  String dbUrl = "jdbc:mysql://localhost:3306/BookDB&useUnicode=true&characterEncoding=utf8";
2.jsp±àÂë
<%@ page language="java" contentType="text/html; charset=utf8"%>
3.Ôö¼Ó¼Ç¼µÄ¶¼×ª»»Îªutf8±àÂëÈçÏÂ:
  content = new String(content.getBytes("iso8859-1"),"utf8"));
 Ðí¶à×Ö·û´®Êý¾ÝÀàÐ͵ÄÁж¨Òå¿ÉÒÔ°üÀ¨Ö¸¶¨×Ö·û¼¯µÄCHARACTER SETÊôÐÔ£¬Ò²¿ÉÄÜ°üÀ¨Ð£¶Ô¹æÔò¡£(CHARSETÊÇCHARACTER SETµÄÒ»¸öͬÒå´Ê£©¡£ÕâЩÊôÐÔÊÊÓÃÓÚCHAR¡¢VARCHAR¡¢TEXTÀàÐÍ¡¢ENUMºÍSET¡£ÀýÈ磺
·                CREATE TABLE t
·                (
·                    c1 CHAR(20) CHARACTER SET utf8,
·                    c2 CHAR(20) CHARACTER SET latin1 COLLATE l


Ïà¹ØÎĵµ£º

mysqlÔÚÔÙ´ÎжÔغóÖØ×°³öÏÖStart services²»ÄÜÆô¶¯

    ×î½ü×öÒ»¸öСÏîÄ¿£¬¸ÕºÃÓöµ½Õâ¸öÎÊÌ⣬ûʲôʱ¼äÈ¥½â¾öÕâ¸öÎÊÌ⣬´ó¸ÅÔÚÍøÉÏÕÒÁËһϣ¬Ëµ¸ÄʵÀýÃû£¬¸Ä×¢²á±í£¬ÏȲ»ÊǺܸҸģ¬±Ï¾¹¶Ô×¢²á±íÒ»Ö±¾õµÃÊǸö´óÉñ£¬²»¸ÒËæ±ã¶¯£¬½ñ¶ùÊÇ»í³öÈ¥ÁË£¬¾ÍÔÚ×¢²á±íÖвéÕÒËùÓдúmysql×ÖÑùµÄÐÅϢȫ²¿É¾³ý£¬×îºó¾¹È»³ÉÁË£¬µ±È»Ð¶Ôغóɾ³ý֮ǰËùÓеÄÏà¹ØÐÅÏ¢£¬°²×°ÎļþÄ¿ ......

Mysql my.ini ÅäÖÃÎļþÏê½â

Mysql my.ini ÅäÖÃÎļþÏê½â
#BEGIN CONFIG INFO
#DESCR: 4GB RAM, ֻʹÓÃInnoDB, ACID, ÉÙÁ¿µÄÁ¬½Ó, ¶ÓÁиºÔØ´ó
#TYPE: SYSTEM
#END CONFIG INFO
#
# ´ËmysqlÅäÖÃÎļþÀý×ÓÕë¶Ô4GÄÚ´æ
# Ö÷ҪʹÓÃINNODB
#´¦Àí¸´ÔÓ¶ÓÁв¢ÇÒÁ¬½ÓÊýÁ¿½ÏÉÙµÄmysql·þÎñÆ÷
#
# ½«´ËÎļþ¸´ÖƵ½/etc/my.cnf ×÷Ϊȫ¾ÖÉèÖÃ,
# mysql-data-d ......

Mysql ´¥·¢Æ÷ʵÀý

MySQL ´¥·¢Æ÷¼òµ¥ÊµÀý
1¡¢Óï·¨£º
CREATE TRIGGER <´¥·¢Æ÷Ãû³Æ>  --´¥·¢Æ÷±ØÐëÓÐÃû×Ö£¬×î¶à64¸ö×Ö·û£¬¿ÉÄܺóÃæ»á¸½Óзָô·û.ËüºÍMySQLÖÐÆäËû¶ÔÏóµÄÃüÃû·½Ê½»ù±¾ÏàÏó.
{ BEFORE | AFTER }  --´¥·¢Æ÷ÓÐÖ´ÐеÄʱ¼äÉèÖ㺿ÉÒÔÉèÖÃΪʼþ·¢ÉúÇ°»òºó¡£
{ INSERT | UPDATE | DELETE }  --ͬÑùÒ²ÄÜÉ趨´¥· ......

mysql update set

update  article set body = (REPLACE(body, '</div>', ' ')) where typeid=21
ÓÃupdateºÍreplaceÔÚmysqlÖÐÌ滻ijһ¸ö×ֶεIJ¿·ÖÄÚÈÝ
update users_settings set `ConfigValue` = replace(configvalue,' fromstr' 'tostr') where `ConfigName`='accesslist'
¶ÔÓÚÕë¶Ô×Ö·û´®Î»ÖõIJÙ×÷£¬µÚÒ»¸öλÖñ»±ê¼Ç ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ