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

MySQL Íâ¼üʹÓÃ

Íâ¼üµÄʹÓÃÌõ¼þ£º
1.Á½¸ö±í±ØÐëÊÇInnoDB±í£¬MyISAM±íÔÝʱ²»Ö§³ÖÍâ¼ü£¨¾Ý˵ÒÔºóµÄ°æ±¾ÓпÉÄÜÖ§³Ö£¬µ«ÖÁÉÙÄ¿Ç°²»Ö§³Ö£©£»
2.Íâ¼üÁбØÐ뽨Á¢ÁËË÷Òý£¬MySQL 4.1.2ÒÔºóµÄ°æ±¾ÔÚ½¨Á¢Íâ¼üʱ»á×Ô¶¯´´½¨Ë÷Òý£¬µ«Èç¹ûÔÚ½ÏÔçµÄ°æ±¾ÔòÐèÒªÏÔʾ½¨Á¢£»
3.Íâ¼ü¹ØϵµÄÁ½¸ö±íµÄÁбØÐëÊÇÊý¾ÝÀàÐÍÏàËÆ£¬Ò²¾ÍÊÇ¿ÉÒÔÏ໥ת»»ÀàÐ͵ÄÁУ¬±ÈÈçintºÍtinyint¿ÉÒÔ£¬¶øintºÍcharÔò²»¿ÉÒÔ£»
Íâ¼üµÄÓô¦£º
¿ÉÒÔʹµÃÁ½Õűí¹ØÁª£¬±£Ö¤Êý¾ÝµÄÒ»ÖÂÐÔºÍʵÏÖһЩ¼¶Áª²Ù×÷£»
Íâ¼üµÄ¶¨ÒåÓï·¨£º
[CONSTRAINT symbol] FOREIGN KEY [id] (index_col_name, ...)
REFERENCES tbl_name (index_col_name, ...)
[ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}]
[ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}]
¸ÃÓï·¨¿ÉÒÔÔÚ CREATE TABLE ºÍ ALTER TABLE ʱʹÓã¬Èç¹û²»Ö¸¶¨CONSTRAINT symbol£¬MYSQL»á×Ô¶¯Éú³ÉÒ»¸öÃû×Ö¡£
ON DELETE¡¢ON UPDATE±íʾʼþ´¥·¢ÏÞÖÆ£¬¿ÉÉè²ÎÊý£º
£¨1£© CASCADE: ´Ó¸¸±íɾ³ý»ò¸üÐÂÇÒ×Ô¶¯É¾³ý»ò¸üÐÂ×Ó±íÖÐÆ¥ÅäµÄÐС£ON DELETE CASCADEºÍON UPDATE CASCADE¶¼¿ÉÓá£ÔÚÁ½¸ö±íÖ®¼ä£¬Äã²»Ó¦¶¨ÒåÈô¸ÉÔÚ¸¸±í»ò×Ó±íÖеÄͬһÁвÉÈ¡¶¯×÷µÄON UPDATE CASCADE×Ӿ䡣
£¨2£©SET NULL: ´Ó¸¸±íɾ³ý»ò¸üÐÂÐУ¬²¢ÉèÖÃ×Ó±íÖеÄÍâ¼üÁÐΪNULL¡£Èç¹ûÍâ¼üÁÐûÓÐÖ¸¶¨NOT NULLÏÞ¶¨´Ê£¬Õâ¾ÍÊÇΨһºÏ·¨µÄ¡£ON DELETE SET NULLºÍON UPDATE SET NULL×Ӿ䱻֧³Ö¡£
£¨3£©NO ACTION: ÔÚANSI SQL-92±ê×¼ÖУ¬NO ACTIONÒâζÕâ²»²ÉÈ¡¶¯×÷£¬¾ÍÊÇÈç¹ûÓÐÒ»¸öÏà¹ØµÄÍâ¼üÖµÔÚ±»²Î¿¼µÄ±íÀɾ³ý»ò¸üÐÂÖ÷Òª¼üÖµµÄÆóͼ²»±»ÔÊÐí½øÐУ¨Gruber, ÕÆÎÕSQL, 2000:181£©¡£ InnoDB¾Ü¾ø¶Ô¸¸±íµÄɾ³ý»ò¸üвÙ×÷¡£
£¨4£©RESTRICT: ¾Ü¾ø¶Ô¸¸±íµÄɾ³ý»ò¸üвÙ×÷¡£NO ACTIONºÍRESTRICT¶¼Ò»Ñù£¬É¾³ýON DELETE»òON UPDATE×Ӿ䡣£¨Ò»Ð©Êý¾Ý¿âϵͳÓÐÑÓÆÚ¼ì²é£¬²¢ÇÒNO ACTIONÊÇÒ»¸öÑÓÆÚ¼ì²é¡£ÔÚMySQLÖУ¬Íâ¼üÔ¼ÊøÊDZ»Á¢¼´¼ì²éµÄ£¬ËùÒÔNO ACTIONºÍRESTRICTÊÇͬÑùµÄ£©¡£
£¨5£©SET DEFAULT: Õâ¸ö¶¯×÷±»½âÎö³ÌÐòʶ±ð£¬µ«InnoDB¾Ü¾ø°üº¬ON DELETE SET DEFAULT»òON UPDATE SET DEFAULT×Ó¾äµÄ±í¶¨Òå¡£


Ïà¹ØÎĵµ£º

windows 7ÏÂÈçºÎ°²×°Apache + PHP + MySQL + SVNµÈµÈ

½üÀ´¶Ôphp±È½Ï¸ÐÐËȤ£¬¾Í¶Ï¶ÏÐøÐøµÄ»¨ÁËÁ½¸öÐÇÆÚµÄʱ¼ä°ÑÕû¸öphp¿ª·¢ÐèÒªÓõ½µÄ¶«Î÷¶¼×°ºÃÁË£¬´ó¸ÅµÄ°²×°¹ý³ÌÈçÏ¡£
Ò»¡¢°²×°µÄÈí¼þ:
Apache: 2.2.14
PHP:5.2.12
MySQL:5.1.42¡£
SVN:1.5.6
PHPMyAdmin:3.2.5
Zend Studio: 7.1
Zend Debugger: 5.1.14
¶þ¡¢°²×°¹ý³Ì£º
1. °²×°ºÍÅäÖÃapache
°²×°£ºÊ×ÏÈ´Óhttp://apa ......

²é¿´MySQLµÄÖ´Ðмƻ®

1.²é¿´MySQL·ÖÇø±íµÄÖ´Ðмƻ®:
×¢Òâ:¶ÔMySQL·ÖÇø±í°´·ÖÇø²éѯ,²»ÓÃÏñOracleÄÇÑù,ÔÚSQLÖÐÌí¼Ó“PARTITION”×Ö·û´®¡£
Ìáʾ£ºÊ¹Ó÷ÖÇø¹¦ÄÜÖ®ºó£¬Ïà¹Ø²éѯ×îºÃ¶¼ÓÃEXPLAIN PARTITIONS¹ýÒ»±é£¬È·ÈÏ·ÖÇøÊÇ·ñÉúЧ¡£ÀýÈç:
EXPLAIN PARTITIONS SELECT * from tab_test WHERE created = '2008-01-02';
2.²é¿´MySQLÆÕͨ± ......

asp.netÁ¬½ÓmysqlÊý¾Ý¿â

MysqlµÄconnector/net5.0ÏÂÔصØÖ·:
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.6.zip/from/pick
°²×°ºÃÒÔºó,
µãÊôÐÔ,È»ºóµã²éÕÒÄ¿±ê,µãÏòÉÏÒ»²ãĿ¼,ÕÒµ½Binaries\.NET 2.0,È»ºó½«Õâ¸öÎļþ¸´ÖƵ½ÄãµÄ¹¤³ÌĿ¼ÏÂ,Ò»°ãÕâÑùµÄDLLÎļþ»á±£´æµ½binĿ¼ÏÂ.
ÔÚ´úÂëÒ³ÀïÊäÈëusing Mysql.Da ......

ÈçºÎÐÞ¸Ämysql rootÃÜÂë

   Íü¼ÇMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)
ROOTÃÜÂëÊÇÔÚMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)ʹÓÃÖкܳ£¼ûµÄÎÊÌ⣬¿ÉÊÇÓкܶàÅóÓѲ¢²»»áÖØÖÃROOTÃÜÂ룬Äǽпడ£¬ÎÒÓÐÉîÓид¥£¬ÌØд´ËÎÄÕÂÓë´ó¼Ò½»Á÷£º
1¡¢±à¼­MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)ÅäÖÃÎļþ£º
windows»·¾³ÖУº%MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)_installdir%\my.ini¡¡//Ò»°ã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ