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

mysql×Ö·û±àÂëµÄËѼ¯

mysql×Ö·û¼¯±àÂëÏòÀ´ÊÇÒ»¸öÄÑÌ⣬ÒòΪÓÐʱºòΪ´ó¶àÊýÈËÏëµÄUTF8¿ÉÒÔ½â¾öһЩÄÑÌ⣬²»¹ý²»ÒªÌ«ÀíÏ뻯ÁË£¬ÓÐʱºòÔÚwindow¿Í»§¶ËÏ Ð޸ijÉutf8£¬mysqlÊDz»Ö§³ÖµÄ£¬ËùÒÔ»¹µÃ¾ßÌåÎÊÌâ¾ßÌå·ÖÎö£¬¿ÉÊÇÕâ¸ö»¹ÕæµÃÐèÒªÄ㻨µãʱ¼äÀ´Ñо¿
ÏÂÃæÊÇһЩ±ðÈ˵ÄÎÄÕ£¬ÔÚ´ËÏÈлÁË
             mysql·þÎñÆ÷ÖÐÓÐÁù¸ö¹Ø¼üλÖÃʹÓÃÁË×Ö·û¼¯µÄ¸ÅÄËûÃÇÊÇ£ºclient¡¢connection¡¢database¡¢results¡¢server¡¢system¡£
             a¡¢ÆäÖÐclientÊÇ¿Í»§¶ËʹÓõÄ×Ö·û¼¯£¬Ï൱ÓÚÍøÒ³ÖеÄ×Ö·û¼¯ÉèÖÃÈçÏÂ
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">¡£
b¡¢ÆäÖеÄconnectionÊÇÁ¬½ÓÊý¾Ý¿âµÄ×Ö·û¼¯ÉèÖÃÀàÐÍ£¬Èç¹ûphpûÓÐÖ¸Ã÷Á¬½ÓÊý¾Ý¿âʹÓõÄ×Ö·û¼¯ÀàÐÍ
¾Í°´ÕÕ·þÎñÆ÷¶ËĬÈϵÄ×Ö·û¼¯ÉèÖá£
c¡¢ÆäÖÐdatabaseÊÇÊý¾Ý¿â·þÎñÆ÷ÖÐij¸ö¿âʹÓõÄ×Ö·û¼¯É趨£¬Èç¹û½¨¿âʱûÓÐÖ¸Ã÷£¬½«Ê¹Ó÷þÎñÆ÷°²×°
ʱָ¶¨µÄ×Ö·û¼¯ÉèÖá£
d¡¢resultsÊÇÊý¾Ý¿â¸ø¿Í»§¶Ë·µ»ØʱʹÓõÄ×Ö·û¼¯É趨£¬Èç¹ûûÓÐÖ¸Ã÷£¬Ê¹Ó÷þÎñÆ÷ĬÈϵÄ×Ö·û¼¯¡£
e¡¢serverÊÇ·þÎñÆ÷°²×°Ê±Ö¸¶¨µÄĬÈÏ×Ö·û¼¯É趨¡£
f¡¢systemÊÇÊý¾Ý¿âϵͳʹÓõÄ×Ö·û¼¯É趨¡£
systemÒ»°ãĬÈÏÊÇutf-8×Ö·û¼¯£¬serverÊÇ×î¸ßµÄ×Ö·û¼¯É趨£¬databaseûÓе¥¶ÀÉ趨¾Í°´ÕÕserverµÄ×Ö·û
¼¯É趨£¬ÆäËû¶¼ÊÇ°´ÕÕserverµÄÉ趨ÉèÖÃ×Ö·û¼¯¡£»¹ÓУ¬Êý¾Ý¿âÄÚµÄÿ¸ö±íºÍ×Ö¶ÎÒ²¶¼ÓÐ×Ö·û¼¯µÄ¸ÅÄһ°ã¶¼
ÊǸù¾ÝÉÏÒ»¼¶½á¹¹¾ö¶¨×ÔÉíµÄ×Ö·û¼¯£¬±ÈÈç±í¾Í¸ù¾Ýdatabase¿âµÄÉ趨¾ö¶¨×Ô¼ºµÄ×Ö·û¼¯£¬×ֶθù¾Ý±íÀ´¾ö¶¨×Ô¼º
µÄ×Ö·û¼¯¡£
¶þ¡¢Í³Ò»×Ö·û¼¯µÄ·½·¨£º£¨ÒÔutf-8×Ö·û¼¯ÎªÀý£¬ÒòΪËûÊÇÄ¿Ç°Ö§³ÖÎÄ×ÖÖÖÀà×î¹ãµÄ×Ö·û¼¯£©
1¡¢³¹µ×½â¾ö×Ö·û¼¯µÄ·½·¨£º
Òª³¹µ×½â¾ö×Ö·û¼¯µÄ·½·¨¾ÍÊÇÈÃmysqlÔÚ°²×°µÄʱºò¾ÍÊÇÓÃutf-8µÄ×Ö·û¼¯É趨£¬ÕâÑù¿ÉÒÔʹÉÏÃæµÄÁù¸ö¹Ø¼ü
µãµÄ±àÂ붼Ϊutf-8¡£
a¡¢ ÔÚwindowsÏ°²×°mysqlÓÐÌáʾ¿ÉÒÔÑ¡Ôñ×Ö·û¼¯£¬ÎÒÃÇÑ¡Ôñutf-8¾Í¿ÉÒÔÁË¡£
b¡¢ÔÚlinuxÏÂÓÐÈýÖÖ°²×°·½·¨£¬µÚÒ»ÖÖÊÇrpm°ü°²×°£¬ÕâÖÖÒòΪÎÒûÓÐʹÓùýËùÒÔûÓз¢ÑÔȨ¡£
µÚ¶þÖÖΪ¿ÉÖ´ÐгÌÐò°²×°£¬ÕâÖÖ°²×°ÒòΪÒѾ­±»±àÒë³ÉÁËlatin1ÕâÖÖÈðµäÓïµÄ×Ö·û¼¯£¬ËùÒÔÎÞ·¨ÍêÈ«½â¾ö×Ö
·û¼¯ÎÊÌ⣬Õâ¸ö°æ±¾ÎÒÃǺóÃæ»á½²µ½Ôõô½â¾ö×Ö·û¼¯ÎÊÌâ¡£
µÚÈýÖÖΪԴÂë×ÔÐбàÒë°²×°£¬ÕâÖÖ°²×°¿ÉÒÔÔÚ±àÒëʱÉèÖÃ×Ö·û¼¯ÀàÐÍ£¬Õⲿ·ÖÖ÷Òª½²ÕâÖÖ°²×°·½Ê½¡£
ÔÚ±à


Ïà¹ØÎĵµ£º

MySQLÖÐselect * for updateËø±íµÄÎÊÌâ


select * for updateËø±íµÄÎÊÌâ
ÓÉÓÚInnoDBÔ¤ÉèÊÇRow-Level Lock£¬ËùÒÔÖ»ÓС¸Ã÷È·¡¹µÄÖ¸¶¨Ö÷¼ü£¬MySQL²Å»áÖ´ÐÐRow lock (Ö»Ëøס±»Ñ¡È¡µÄ×ÊÁÏÀý) £¬·ñÔòMySQL½«»áÖ´ÐÐTable Lock (½«Õû¸ö×ÊÁÏ±íµ¥¸øËøס)¡£
¾Ù¸öÀý×Ó:
¼ÙÉèÓиö±íµ¥products £¬ÀïÃæÓÐid¸úname¶þ¸öÀ¸Î»£¬idÊÇÖ÷¼ü¡£
Àý1: (Ã÷È·Ö¸¶¨Ö÷¼ü£¬²¢ÇÒÓд˱Ê×ÊÁÏ£¬ ......

java¶ÔmysqlÊý¾Ý¿âµÄµ¼Èëµ¼³ö

//µ¼³ö
String mysql="mysqldump -uroot -proot  --opt databasename > d:/test.sql";    
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);   
//µ¼Èë
String mysql="mysqladmin -uroot -proot create databasename";    
java.lang.Runt ......

Mysql EngineÀàÐÍ

¿´MySQL²Î¿¼ÊÖ²á ·¢ÏÖCREATE TABLE ʱÓжàÖÖÊý¾Ý¿â´æ´¢ÒýÇ棺
TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM }
ÍøÉϲéÁËϾÝ˵MyISAM¡¢InnoDBÁ½ÖÖÒýÇæ³£ÓÃ
´óÖÁÇø±ðÈçÏÂ[²»ÖªÊÇ·ñ׼ȷ]£º
¸ß¼¶´¦Àí:
MyISAMÀàÐͲ»Ö§³ÖÊÂÎñ´¦ÀíµÈ¸ß¼¶´¦Àí£¬¶øInnoDBÀàÐÍÖ§³Ö¡£
Ö´ÐÐËÙ¶È:
MyISAMÀàÐ͵ıíÇ¿µ÷µÄÊÇÐ ......

MySQL .Íâ¼üÔ¼Êø

InnoDBÒ²Ö§³ÖÍâ¼üÔ¼Êø¡£InnoDBÖжÔÍâ¼üÔ¼Êø¶¨ÒåµÄÓï·¨¿´ÆðÀ´ÈçÏ£º
[CONSTRAINT symbol] FOREIGN KEY [id] (index_col_name, ...)
    REFERENCES tbl_name (index_col_name, ...)
    [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
    [ON UPDATE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ