如题所述
ä¸ç¯è¯¦ç»è®²è¿°mysqlåaccessåºå«ç好æç« ï¼
MySQLâ¶ç½ç«å¼åè çæ°éæ©
ãåå¨ãè¿ä¸¤ä¸ªå对 IT ä¸çæ¥è¯´æ¯åæ®éä¸è¿çäºäºãå¦æä»å¤©ç®¡çé¶å±ç主管们è·ä½ è¦æ°æ®åºçæ¨èååï¼å¾å¯è½å¨ä½ å¼å§æ§è¡ä½ ææ¨èçæ¹æ¡ä¹åï¼ä½ çæ¨èååä¸ç项ç®å°±å·²ç»è¿æ¶äºã å¦æ¤ä¸æ¥ï¼ä½ å¯è½å°±è¦éæ°èèåç§è½¯ç¡¬ä»¶æ¹æ¡ï¼å¥½è®©ä½ â¶
Â·å¸®ä½ å°äºæ å®æ
·买æ¥ä»¥ä¾¿å¸®å©å«äººå®æä»ä»¬çå·¥ä½
·å¼å以便帮å©å«äººæ´å¥½å°å®æä»ä»¬çå·¥ä½
ä¸è®ºä½ çæ¶æ¯æå¤æ°ï¼å¨ä½ ç建议éè¿å±å±å ³å¡ï¼å¹¶ä¸æ¿å°è´ä¹°èµéä¹åï¼ä½ çæ¨è表ä¸çæäºé¡¹ç®é常é½ä¼è¿æ¶ã幸è¿çæ¯ï¼æ²¡æ人ä¼è´£æªä½ ï¼æè æ¯å¯¹ä½ ååç¸è®¥ -- è¿æ¯è¿ä¸è¡éå¾èªç¶çäºæ ãæ°æ®åºææ¯é常å¨ä½ è½å¤ææ¡å®ä¹åå°±åäºã
为äºéåºæ¥æ°æå¼çæ°æ®åºææ¯ï¼æç¸å½å¤ç软件工ç¨å¸éæ¸å°ä»æ¡é¢æ°æ®åºè½¯ä»¶è¯¸å¦ Microsoft Access 以å SQL Serverï¼è½¬å°ä½¿ç¨ MySQLãè½ç¶ä¸¥æ ¼è¯´æ¥MySQL 并é SQL Server ç对æï¼ä½è®¸å¤æå¡æä¾åé½æ¯æ MySQLï¼å¹¶è§ä¹ä¸ºä¾¿å®èææççæ¿ä»£åã
Susan Sales Harkins ç»å¸¸å¨ CNET Builder.com å表æç« ï¼æ¯ä¸ä½ç²¾é微软 Office çä¸å®¶ã她ä¹æ¯Using Microsoft Access 97åUsing Microsoft Access 2000两书çä½è ï¼è¿ä¸¤æ¬ä¹¦åç± Que æåºçã
Martin W. P. Reid ä¹ç»å¸¸å¨ CNET Builder.com å表æç« ï¼æ¯è±å½è´å°æ³æ¯ç¹å¥³ç大å¦ï¼Queen's Universityï¼ çåæå¸æ¨ç¨åºè®¾è®¡åãä»ä¹æå¯¼å ³ç³»åæ°æ®åºè®¾è®¡ç课ç¨ï¼å·¥ä½ä¹ä½ä¹ä¸ºåç±å°å °çä¸äºå°åä¼ä¸å å½æ°æ®åºé¡¾é®ã
â²èèä½¿ç¨ MySQL çåå
å¦æä½ è¦æ¾çæ¯å¯é çæ°æ®åºè½¯ä»¶ï¼ä»¥ä¾¿æ¯æä½ çç½ç«å¼åå·¥ä½ï¼é£ä¹ä»¥ä¸çåå 就说æäºä½ 为ä»ä¹åºè¯¥èè MySQLèä¸æ¯å ¶å®æ°æ®åºâ¶
·å®ä¾¿å®ï¼é常æ¯å è´¹ï¼ã
·å®çç½ç»æ¿è½½æ¯è¾å°ã
·å®ç»è¿å¾å¥½çä¼åï¼Highly Optimizedï¼ã
·åºç¨ç¨åºéè¿å®åå¤ä»½æ¥æ¯è¾ç®åã
·å®ä¸ºåç§ä¸åçèµææ ¼å¼æä¾æå¼¹æ§çæ©å±ä»é¢ (ODBC)ã
·å®è¾å¥½å¦ï¼ä¸æä½ç®åã
Â·ä½ è´æ å¾èµ·ç客æ·æ¯æè´¹ç¨ã
â²å ³äºâ$âçé®é¢
ç®åç说ï¼ä½ ä¸ä¼æ¾å°æ¯ MySQL æ´ä¾¿å®çäºãäºå®ä¸ï¼å¯¹å¤§å¤æ°ç¨æ·æ¥è¯´ï¼MySQL æ¯å è´¹çãææ¶åè½ç¶æ¯è¦ä»åºä¸å°ç¬çææè´¹ï¼ä½æ¯è¿ä¸ªä»è´¹è§å®åªéäºä»¥ä¸ä¸¤ç§æ åµâ¶
·以å åµï¼embeddedï¼çæ¹å¼ä½¿ç¨ MySQL æå¡å¨
·åªä½¿ç¨ MySQL çåä¸ç¨é软件
ä¾å¦ï¼Windows çæ¬ç MySQL æå¡å¨ï¼éè¦ææãè½ç¶åªä»æ¯ç¾é $200 å å¤ä¸ç¹ç¹çè´¹ç¨ï¼MySQL è¿æ¯æ¯å ¶ä»ä»»ä½æ°æ®åºè½¯ä»¶æ¥å¾æ´ä¾¿å®å¤äºãOffice XP Developer çé¶å®ä»·æ¯ç¾é $799 å ï¼å级çåæ¯ç¾é $549 å ãAccess 2002 çä»·æ ¼æ¯ç¾é $339 å ï¼å级çåæ¯ç¾é $109 å ã
â² é¿å å µå¡
é对å¤ä¸ªä½¿ç¨è å ±å读åä¿¡æ¯çéæ±ï¼Access æ ¹æ¬ä¸æ¯ MySQL ç对æãAccess å¨å¤§çº¦åäºä¸ªä½¿ç¨è è¿ä¸æ¥çæ¶åï¼å°±è¾æäºãæ们è¿å¬è¯´è¿å½åªæäºä¸ªäººè¿ä¸æ¥æ¶ï¼ å°±ä¼æä¸äºé®é¢ï¼è¿å¹¶ä¸æ¯è¯´ï¼åªæäºä¸ªäººè½å¤åæ¶è¿ä¸ç± Access æ°æ®åºæ¯æçç½ç«ï¼ãâåæ¶è¿ç»âï¼Simultaneous connectionï¼äºå®ä¸æ¯ä¸ç§å¹¶åå¤çï¼concurrent processï¼ãå æ¤ï¼è½ç¶äºå®ä¸ Access å¯ä»¥å¤ççè¿ç»æ°ç®æ¯æ éå¶çï¼ä½åªè¦é£äºè¿ç»ä¿æå¨å¹¶åå¤ççèå´éå¶å å°±æ²¡å ³ç³»ã对äºåªè¯»ç½ç«ï¼è¿äºç½ç«å¹¶éä½ æ³åä¸çå°æ°ï¼å®å¯ä»¥æ¯æå°æå¤å° 255 个使ç¨è ãèè¾å¤§çç½ç«ï¼åæ å¯é¿å çå¿ é¡»åçº§å° SQL Server 以æé«ç¨³å®æ§åæçã
ç¸å¯¹è¯´æ¥ï¼MySQL å å®æ大è¿ç»æ°ä¸º 100 个使ç¨è ãä½æ¯ï¼æ们ç»å¯¹ä¸å¯ä»¥ç¨ä¸ä¸ªç¨åºçå 建设å®æ¥å¤æå®çæè½ãå°ç®å为æ¢ï¼æ们è¿æ²¡å¬è¯´è¿ä½¿ç¨ MySQL çè¾å¤§èä¸è®¿é®é¢ç¹çç½ç«ä¸ç使ç¨è æä»»ä½æ±æ¨ãé¤æ¤ä¹å¤ï¼å³ä½¿æç½ç»ä¸æ 大é çèµæå¾æ¥ï¼ä¼¼ä¹å¹¶ä¸ä¼å¯¹MYSQLçæ¥è¯¢ä¼åï¼query optimizationï¼é æå¤å¤§çå½±åã
å¨ Windows 98 æä½ç³»ç»ä¸ä½¿ç¨ç¸åç硬件åæ°æ®å°ºå¯¸ï¼MySQL 表ç°å¾æ¯ Access 2000 è¿è¦å¿« â ä½åªæ¯å¹¶éææçæ åµä¸é½æ¯å¦æ¤ã è¿ä¸¤è å¨èµææ´æ°æ¹é¢çæè½ï¼æçå¾å¤§çå·®å¼ï¼åæ ·çèµææ´æ°ï¼Access è¦è±ä¸ä¸¤åçæ¶é´ãå¦ææ¯å¨é«éç³»ç»ä¸åå°éçèµæçå¤çï¼ä½ ä¸ä¼å»æ³¨æå°è¿ä¸¤è é´çå·®å¼ã ä½åªæå¨å¤ççæ¯å åä¸ç¬èµæçæ¶åï¼è¿æè½ä¸çå·®å¼æä¼ææ¾ãMySQL åªå¨å¤çæ°æ®åºå¯¹è±¡ç»æï¼object structureï¼çæ¶åï¼æä¼è¾ç» Accessã å½å»ºç«è¡¨æ ¼ï¼tableï¼ ä»¥åç´¢å¼çæ¶åï¼MySqL ä¼å°è¡¨æ ¼éä½ï¼å¦æ¤ä¸æ¥ä¼å¯¼è´æ£å¨è¿è¡ç大éèµæå¤çéåº¦æ ¢ä¸æ¥ãç¶è以ä¸ææå°çæåä¸ä¸ªé®é¢å¨ç½ç«å¼åæ¶ï¼é常并ä¸ä¼é æ麻ç¦ã å 为ç½ç«ä¸ï¼æ们æéè§çæ¯ç¨æ·æ¥è®¿æ¶æ¥è¯¢çé度ï¼èéèµæå¨åç»ææ¬èº«ãå æ¤ï¼å¨è¿ä¸ªé¢åï¼MySQL èå©ã
â²MYSQLå ¶å®çä¼ç¹
·ä¼å
å¯¹äº MySQL çä¼åï¼æ们å¯ä»¥è¯´ï¼ä¸»è¦çé®é¢å¨äºä½ ç硬件æ¡ä»¶ï¼èé MySQL æ¬èº«ãä¸è¿å¯¹äº Accessï¼ï¼ä»¥åå ¶ä»æ¡é¢æ°æ®åºè½¯ä»¶ï¼äºæ å°±ä¸æ¯è¿æ ·äºã 没éï¼Microsoft Jet Database çç¡®å®ææçï¼ä¸è¿å®è¿ä¸æ¯æå¿«çãå¦æä½ çæ°æ®åºè®¾è®¡å¾é常差ï¼ä½ çç½ç«è¿æ¯ä¼åå°å½±åèé度åæ ¢çã æ°æ®åºç»æ设计ä¹ä¼å½±åå° MySQLï¼ä¾å¦ï¼MySQL 并ä¸æ¯æå¤é®ï¼foreign keyï¼ãè¿ä¸ªç¼ºç¹ä¼å½±åå°ä½ çæ°æ®åºè®¾è®¡ä»¥åç½ç«çæçã对äºä½¿ç¨ MySQL åæ°æ®åºçç½ç«ï¼ä½ åºè¯¥æ³¨æçæ¯ï¼å¦ä½è®©ç¡¬çååIOåå°å°æä½å¼ãå¦ä½è®©ä¸ä¸ªæå¤ä¸ª CPU éæ¶ä¿æå¨é«éä½ä¸çç¶æã以åéå½çç½ç»å¸¦å®½ï¼ èéå®é ä¸çæ°æ®åºè®¾è®¡ä»¥åèµææ¥è¯¢è¯å¥ãäºå®ä¸ï¼æäºç½ç«å¼åè å° MySQL 称为ç®åå¸é¢ä¸è·å¾æå¿«çæ°æ®åºãä¸è¿ï¼å½ä½ çæ°æ®åºæå¾å¤è¡¨æ ¼éè¦åæ¶å¨ä¸ä¸ªäºå¡è¿ç¨ï¼transactionï¼å å®ææ´æ°çæ¶åï¼MySQL çç¡®è·å¾ä¸æä¹æ ·ã
·å¤ä»½
å¦æä½ æ¾ç»æè¿æ¢æä¸ä¸ªæåç MDB æ¡£æ¡çæ¨çç»éªï¼é£ä¹ä½ ä¼å¯¹ MySQL 表示é常æ¿èµãè¿æ¯ MySQL å¦ä¸ä¸ªèè¿ Access çå°æ¹ãé¦å ï¼mysqldump ä¼äº§çä¸ä¸ªæ¯ Access 好å¾å¤èä¸ä¹æ´å¯é çå¤ä»½æ¡£æ¡ãç¸æ¯ä¹ä¸ï¼å¨ Accessä¸ä½ åªæ¯å°ä¸ä¸ª MDB æ¡£æ·è´èµ·æ¥åå¤ä»½ãå ¶æ¬¡ï¼å³ä½¿ MySQL çå¤ä»½æé¨åæåï¼å¤åèµ·æ¥ä¹è¦æ¯ä¸ä¸ªæåç MDB æ¡£è¦å®¹æå¾å¤äºã
·å¯å»¶ä¼¸æ§ï¼Scalabilityï¼ä»¥åèµæå¤çè½å
å¥å¥ç»å±±è çè¯æ¥è¯´ï¼å° Access æ°æ®åºæ¥è· MySQL ç¸æ¯ï¼ç®ç´å°±æ¯åæå°ç¬¬å®é£çå°å±±ä¸æ¿æ¥è·ç§ç½æå¤æ´ç¶å±±èç Pike's Peak 顶ç¸æ¯è¾ãäºå®å°±æ¯è¿ä¹ç®åâ¶MySQL å¯ä»¥å¤ççæ¡£æ¡æ¯ Access æè½å¤ççæ¡£æ¡å¤§å¾å¤ãå¦æä½ ç¡¬å° Access æ°æ®åºå¼å° 100MB ç MDB æ¡£æ¡æ¶ï¼ä½ è¦åå¤å¥½ä¸ä¸ªåå ¸åç纪å½æ¬æ¥è®°å½æ¥èªå®¢æ·å¯¹äºç½ç«æçä½ä¸çæ±æ¨ãè类似çæ°æ®åºå¨ MySQL ä¸é¢è·ï¼å°±ä¸ä¼åçæ¿è½½è¿éç迹象ã
å¦å¤ï¼MySQL åæ¶æä¾é«åº¦å¤æ ·æ§ï¼è½å¤æä¾å¾å¤ä¸åç使ç¨è ä»é¢ï¼å æ¬å½ä»¤è¡å®¢æ·ç«¯æä½ï¼ç½é¡µæµè§å¨ï¼ä»¥ååå¼åæ ·çç¨åºè¯è¨ä»é¢ï¼ä¾å¦ C+ï¼Perlï¼Javaï¼PHPï¼ä»¥å Pythonãä½ å¯ä»¥ä½¿ç¨äºå å è£ å¥½ç客æ·ç«¯ï¼æè å¹²èèªå·±åä¸ä¸ªåéçåºç¨ç¨åºãMySQL å¯ç¨äº Unixï¼Windowsï¼ä»¥å OS/2 çå¹³å°ï¼å æ¤å®å¯ä»¥ç¨å¨ä¸ªäººçµèæè æ¯æå¡å¨ä¸ã
没éï¼Microsoft ActiveX Data Objects Libraryï¼ADOï¼çç¡®ä½¿å¾ Access å¨å¤é¨èµæå¸åºï¼foreign data marketï¼ä¸è½å¤åæ´å ·å¼¹æ§çåºç¨ãå®è½å¤è®©ä½ ä¸ç¨ç®¡èµæçæå¨ä½ç½®èååºèµæï¼ç¶åå¨å ¬ç¨çä»é¢ä¸ï¼å³ç½é¡µæµè§å¨ï¼å°èµææ¾ç¤ºåºæ¥ãä¸è¿ï¼å ¶åå¤æ¯ ADO æ¯ç«æ¯æ¯è¾ç¬¨éï¼å®æ¬èº«å°±æ¯ä¸ªèµæºå¤§æç©ï¼èä¸å¦ä¹ å®è¦è±ä¸å°çéé±è·æ¶é´ï¼å°±ç®ä½ æ¯ä¸ä¸ªè½åä¸éçå¼åå·¥ç¨å¸æè 软件工ç¨å¸ä¹ä¸æ ·ã没æ人è½å¨ä¸å¤©å å° ADO å¦ä¼ã
â²å¦ä¹ æ²çº¿
å¦æä½ å·²ç»çææ°æ®åºææ¯ï¼é£ä¹åºæ¬ä¸ä½ å·²ç»æ²¡ä»ä¹é®é¢äºãç²¾éæ°æ®åºç人å¨ä¸å¤©ä¹å å°±å¯ä»¥æ MySQL å¦ä¼ï¼æè¿ä¸ªç»éªå å°ä»çå±¥å表éé¢å»ãç¸è¾ä¹ä¸ï¼Access æ¯ä¸ªå¤æå¾å¤çæ°æ®åºåå¼åå·¥å ·ãå³ä½¿æ¯ä¸ä¸ªè½åä¸éçå¼åå·¥ç¨å¸ä¹éè¦ä¸æ®µæ¶é´æè½å ·å¤è¶³å¤çä¸ä¸ç¥è¯ï¼ææå°ä½¿ç¨è¿ä¸ªè½¯ä»¶ã
æ£å¦ä½ æå¾ çï¼MySQL æ¯æç»æåæ¥è¯¢è¯è¨ï¼Structured Query Language ,SQLï¼ãå¦æä½ å·²ç»å¦ä¼æç§çæ¬ç SQL è¯è¨ï¼äºæ ä¼å¥½åå¾å¤ãå ·æ VB æè æ¯ VBA ç¥è¯èæ¯çå¼åå·¥ç¨å¸ä¼åç°ï¼ä»ä»¬ä»¥åæå ·å¤ç ASP èæ¯ï¼è½å¤å¸®å©ä»ä»¬ç¼©çå¦ä¹ æ¶é´ã
â²å®¢æ·æ¯æ
è½ç¶å¥½ç¨èä¸å è´¹ç客æ·æ¯æå·²ä¸åå¨ï¼ç¶èMySQL åæä¾äºä¸äºçµå群ç»ååä¾æ¨åèãæä¸äºæ¯é¢å ·ææ¯æ§çï¼èä¸ä¼å们å¾å¾äºç¸æä¾æä½³ç客æ·æ¯æ -- ä»ä»¬å½¼æ¤å享ç»éªåä¸ä¸ç¥è¯ãæ¤å¤ï¼ä½ è¿å¯ä»¥è´ä¹°å ·æ 客æ·æ¯æ ççæ¬ï¼å æ¬ email æ¯ææè çµè¯æ¯æçæ¹å¼ã大è´ä¸æ¥è¯´ï¼å®¢æ·æ¯æè´¹ç并éåºå®çï¼å æ¤æ们æ æ³æä¾ä½ ç¸å ³ä»·ä½çä¿¡æ¯ã
â²MySQL çä¸è¶³ä¹å¤
Access æ¯ä¸ä¸ªå ³èæ§æ°æ®åºç®¡çç³»ç»ï¼RDBMSï¼ï¼ç¶è MySQL 并éå¨æ¯ä¸ä¸ªå±é¢é½æ¯å¦æ¤ãè¿è¡¨ç¤ºï¼è½ç¶ MySQL å¾å¥½ç¨ï¼å®è¿ä¸æ¯æ好çã 以ä¸å表记å½äºç®åå ³èæ§å±é¢ä»¥å管çå±é¢ï¼MySQL å°æªæ¯æçé¨å:
MySQL 没æ³å¤çå¤æçå ³èæ§æ°æ®åºåè½ï¼ä¾å¦ï¼åæ¥è¯¢ï¼subqueriesï¼ï¼è½ç¶å¤§å¤æ°çåæ¥è¯¢é½å¯ä»¥æ¹åæ joinãæ们æå¾ ä¸ä¸çåºæ¥æ¶ï¼è¿é¡¹åè½ä¼è¢«å è¿æ¥ã
å¦ä¸ä¸ª MySQL 没ææä¾æ¯æçåè½æ¯äºå¡å¤çï¼transactionï¼ä»¥åäºå¡çæ交ï¼commitï¼/æ¤éï¼rollbackï¼ã ä¸ä¸ªäºå¡æçæ¯è¢«å½ä½ä¸ä¸ªåä½æ¥å ±åæ§è¡çä¸ç¾¤æä¸å¥å½ä»¤ãå¦æä¸ä¸ªäºå¡æ²¡æ³å®æï¼é£ä¹æ´ä¸ªäºå¡éé¢æ²¡æä¸ä¸ªæ令æ¯çæ£æ§è¡ä¸å»çã对äºå¿ é¡»å¤ç线ä¸è®¢åçåä¸ç½ç«æ¥è¯´ï¼ MySQL 没ææ¯æè¿é¡¹åè½ï¼ç确让人è§å¾å¾å¤±æã ä½æ¯å¯ä»¥ç¨MaxSQLï¼ä¸ä¸ªåå¼çæå¡å¨ï¼å®è½éè¿å¤æçè¡¨æ ¼æ¥æ¯æäºå¡åè½ã
å¤é®ï¼foreign keyï¼ä»¥ååèå®æ´æ§éå¶ï¼referential integrityï¼å¯ä»¥è®©ä½ å¶å®è¡¨æ ¼ä¸èµæé´ç约æï¼ç¶åå°çº¦æï¼constraintï¼å å°ä½ æè§å®çèµæéé¢ãè¿äºMYSQL没æçåè½è¡¨ç¤ºä¸ä¸ªæèµå¤æçèµæå ³ç³»çåºç¨ç¨åºå¹¶ä¸éåä½¿ç¨ MySQLã å½æ们说 MySQL ä¸æ¯æå¤é®æ¶ï¼æ们æçå°±æ¯æ°æ®åºçåèå®æ´æ§éå¶ -- MySQL 并没ææ¯æå¤é®çè§åï¼å½ç¶æ´æ²¡ææ¯æè¿éå é¤ï¼cascading deleteï¼çåè½ã ç®çç说ï¼å¦æä½ çå·¥ä½éè¦ä½¿ç¨å¤æçèµæå ³èï¼é£ä½ è¿æ¯ç¨åæ¥ç Access å§ã
ä½ å¨ MySQL ä¸ä¹ä¸ä¼æ¾å°åå¨è¿ç¨ï¼stored procedureï¼ä»¥å触åå¨ï¼triggerï¼ãï¼é对è¿äºåè½ï¼å¨ Access æä¾äºç¸å¯¹çäºä»¶è¿ç¨ï¼event procedureï¼ãï¼
Access ç GetRows åè½ï¼æä¾äºè¾å¥½çèµææ¾åã
MySQLâ¶ç½ç«å¼åè çæ°éæ©
ãåå¨ãè¿ä¸¤ä¸ªå对 IT ä¸çæ¥è¯´æ¯åæ®éä¸è¿çäºäºãå¦æä»å¤©ç®¡çé¶å±ç主管们è·ä½ è¦æ°æ®åºçæ¨èååï¼å¾å¯è½å¨ä½ å¼å§æ§è¡ä½ ææ¨èçæ¹æ¡ä¹åï¼ä½ çæ¨èååä¸ç项ç®å°±å·²ç»è¿æ¶äºã å¦æ¤ä¸æ¥ï¼ä½ å¯è½å°±è¦éæ°èèåç§è½¯ç¡¬ä»¶æ¹æ¡ï¼å¥½è®©ä½ â¶
Â·å¸®ä½ å°äºæ å®æ
·买æ¥ä»¥ä¾¿å¸®å©å«äººå®æä»ä»¬çå·¥ä½
·å¼å以便帮å©å«äººæ´å¥½å°å®æä»ä»¬çå·¥ä½
ä¸è®ºä½ çæ¶æ¯æå¤æ°ï¼å¨ä½ ç建议éè¿å±å±å ³å¡ï¼å¹¶ä¸æ¿å°è´ä¹°èµéä¹åï¼ä½ çæ¨è表ä¸çæäºé¡¹ç®é常é½ä¼è¿æ¶ã幸è¿çæ¯ï¼æ²¡æ人ä¼è´£æªä½ ï¼æè æ¯å¯¹ä½ ååç¸è®¥ -- è¿æ¯è¿ä¸è¡éå¾èªç¶çäºæ ãæ°æ®åºææ¯é常å¨ä½ è½å¤ææ¡å®ä¹åå°±åäºã
为äºéåºæ¥æ°æå¼çæ°æ®åºææ¯ï¼æç¸å½å¤ç软件工ç¨å¸éæ¸å°ä»æ¡é¢æ°æ®åºè½¯ä»¶è¯¸å¦ Microsoft Access 以å SQL Serverï¼è½¬å°ä½¿ç¨ MySQLãè½ç¶ä¸¥æ ¼è¯´æ¥MySQL 并é SQL Server ç对æï¼ä½è®¸å¤æå¡æä¾åé½æ¯æ MySQLï¼å¹¶è§ä¹ä¸ºä¾¿å®èææççæ¿ä»£åã
Susan Sales Harkins ç»å¸¸å¨ CNET Builder.com å表æç« ï¼æ¯ä¸ä½ç²¾é微软 Office çä¸å®¶ã她ä¹æ¯Using Microsoft Access 97åUsing Microsoft Access 2000两书çä½è ï¼è¿ä¸¤æ¬ä¹¦åç± Que æåºçã
Martin W. P. Reid ä¹ç»å¸¸å¨ CNET Builder.com å表æç« ï¼æ¯è±å½è´å°æ³æ¯ç¹å¥³ç大å¦ï¼Queen's Universityï¼ çåæå¸æ¨ç¨åºè®¾è®¡åãä»ä¹æå¯¼å ³ç³»åæ°æ®åºè®¾è®¡ç课ç¨ï¼å·¥ä½ä¹ä½ä¹ä¸ºåç±å°å °çä¸äºå°åä¼ä¸å å½æ°æ®åºé¡¾é®ã
â²èèä½¿ç¨ MySQL çåå
å¦æä½ è¦æ¾çæ¯å¯é çæ°æ®åºè½¯ä»¶ï¼ä»¥ä¾¿æ¯æä½ çç½ç«å¼åå·¥ä½ï¼é£ä¹ä»¥ä¸çåå 就说æäºä½ 为ä»ä¹åºè¯¥èè MySQLèä¸æ¯å ¶å®æ°æ®åºâ¶
·å®ä¾¿å®ï¼é常æ¯å è´¹ï¼ã
·å®çç½ç»æ¿è½½æ¯è¾å°ã
·å®ç»è¿å¾å¥½çä¼åï¼Highly Optimizedï¼ã
·åºç¨ç¨åºéè¿å®åå¤ä»½æ¥æ¯è¾ç®åã
·å®ä¸ºåç§ä¸åçèµææ ¼å¼æä¾æå¼¹æ§çæ©å±ä»é¢ (ODBC)ã
·å®è¾å¥½å¦ï¼ä¸æä½ç®åã
Â·ä½ è´æ å¾èµ·ç客æ·æ¯æè´¹ç¨ã
â²å ³äºâ$âçé®é¢
ç®åç说ï¼ä½ ä¸ä¼æ¾å°æ¯ MySQL æ´ä¾¿å®çäºãäºå®ä¸ï¼å¯¹å¤§å¤æ°ç¨æ·æ¥è¯´ï¼MySQL æ¯å è´¹çãææ¶åè½ç¶æ¯è¦ä»åºä¸å°ç¬çææè´¹ï¼ä½æ¯è¿ä¸ªä»è´¹è§å®åªéäºä»¥ä¸ä¸¤ç§æ åµâ¶
·以å åµï¼embeddedï¼çæ¹å¼ä½¿ç¨ MySQL æå¡å¨
·åªä½¿ç¨ MySQL çåä¸ç¨é软件
ä¾å¦ï¼Windows çæ¬ç MySQL æå¡å¨ï¼éè¦ææãè½ç¶åªä»æ¯ç¾é $200 å å¤ä¸ç¹ç¹çè´¹ç¨ï¼MySQL è¿æ¯æ¯å ¶ä»ä»»ä½æ°æ®åºè½¯ä»¶æ¥å¾æ´ä¾¿å®å¤äºãOffice XP Developer çé¶å®ä»·æ¯ç¾é $799 å ï¼å级çåæ¯ç¾é $549 å ãAccess 2002 çä»·æ ¼æ¯ç¾é $339 å ï¼å级çåæ¯ç¾é $109 å ã
â² é¿å å µå¡
é对å¤ä¸ªä½¿ç¨è å ±å读åä¿¡æ¯çéæ±ï¼Access æ ¹æ¬ä¸æ¯ MySQL ç对æãAccess å¨å¤§çº¦åäºä¸ªä½¿ç¨è è¿ä¸æ¥çæ¶åï¼å°±è¾æäºãæ们è¿å¬è¯´è¿å½åªæäºä¸ªäººè¿ä¸æ¥æ¶ï¼ å°±ä¼æä¸äºé®é¢ï¼è¿å¹¶ä¸æ¯è¯´ï¼åªæäºä¸ªäººè½å¤åæ¶è¿ä¸ç± Access æ°æ®åºæ¯æçç½ç«ï¼ãâåæ¶è¿ç»âï¼Simultaneous connectionï¼äºå®ä¸æ¯ä¸ç§å¹¶åå¤çï¼concurrent processï¼ãå æ¤ï¼è½ç¶äºå®ä¸ Access å¯ä»¥å¤ççè¿ç»æ°ç®æ¯æ éå¶çï¼ä½åªè¦é£äºè¿ç»ä¿æå¨å¹¶åå¤ççèå´éå¶å å°±æ²¡å ³ç³»ã对äºåªè¯»ç½ç«ï¼è¿äºç½ç«å¹¶éä½ æ³åä¸çå°æ°ï¼å®å¯ä»¥æ¯æå°æå¤å° 255 个使ç¨è ãèè¾å¤§çç½ç«ï¼åæ å¯é¿å çå¿ é¡»åçº§å° SQL Server 以æé«ç¨³å®æ§åæçã
ç¸å¯¹è¯´æ¥ï¼MySQL å å®æ大è¿ç»æ°ä¸º 100 个使ç¨è ãä½æ¯ï¼æ们ç»å¯¹ä¸å¯ä»¥ç¨ä¸ä¸ªç¨åºçå 建设å®æ¥å¤æå®çæè½ãå°ç®å为æ¢ï¼æ们è¿æ²¡å¬è¯´è¿ä½¿ç¨ MySQL çè¾å¤§èä¸è®¿é®é¢ç¹çç½ç«ä¸ç使ç¨è æä»»ä½æ±æ¨ãé¤æ¤ä¹å¤ï¼å³ä½¿æç½ç»ä¸æ 大é çèµæå¾æ¥ï¼ä¼¼ä¹å¹¶ä¸ä¼å¯¹MYSQLçæ¥è¯¢ä¼åï¼query optimizationï¼é æå¤å¤§çå½±åã
å¨ Windows 98 æä½ç³»ç»ä¸ä½¿ç¨ç¸åç硬件åæ°æ®å°ºå¯¸ï¼MySQL 表ç°å¾æ¯ Access 2000 è¿è¦å¿« â ä½åªæ¯å¹¶éææçæ åµä¸é½æ¯å¦æ¤ã è¿ä¸¤è å¨èµææ´æ°æ¹é¢çæè½ï¼æçå¾å¤§çå·®å¼ï¼åæ ·çèµææ´æ°ï¼Access è¦è±ä¸ä¸¤åçæ¶é´ãå¦ææ¯å¨é«éç³»ç»ä¸åå°éçèµæçå¤çï¼ä½ ä¸ä¼å»æ³¨æå°è¿ä¸¤è é´çå·®å¼ã ä½åªæå¨å¤ççæ¯å åä¸ç¬èµæçæ¶åï¼è¿æè½ä¸çå·®å¼æä¼ææ¾ãMySQL åªå¨å¤çæ°æ®åºå¯¹è±¡ç»æï¼object structureï¼çæ¶åï¼æä¼è¾ç» Accessã å½å»ºç«è¡¨æ ¼ï¼tableï¼ ä»¥åç´¢å¼çæ¶åï¼MySqL ä¼å°è¡¨æ ¼éä½ï¼å¦æ¤ä¸æ¥ä¼å¯¼è´æ£å¨è¿è¡ç大éèµæå¤çéåº¦æ ¢ä¸æ¥ãç¶è以ä¸ææå°çæåä¸ä¸ªé®é¢å¨ç½ç«å¼åæ¶ï¼é常并ä¸ä¼é æ麻ç¦ã å 为ç½ç«ä¸ï¼æ们æéè§çæ¯ç¨æ·æ¥è®¿æ¶æ¥è¯¢çé度ï¼èéèµæå¨åç»ææ¬èº«ãå æ¤ï¼å¨è¿ä¸ªé¢åï¼MySQL èå©ã
â²MYSQLå ¶å®çä¼ç¹
·ä¼å
å¯¹äº MySQL çä¼åï¼æ们å¯ä»¥è¯´ï¼ä¸»è¦çé®é¢å¨äºä½ ç硬件æ¡ä»¶ï¼èé MySQL æ¬èº«ãä¸è¿å¯¹äº Accessï¼ï¼ä»¥åå ¶ä»æ¡é¢æ°æ®åºè½¯ä»¶ï¼äºæ å°±ä¸æ¯è¿æ ·äºã 没éï¼Microsoft Jet Database çç¡®å®ææçï¼ä¸è¿å®è¿ä¸æ¯æå¿«çãå¦æä½ çæ°æ®åºè®¾è®¡å¾é常差ï¼ä½ çç½ç«è¿æ¯ä¼åå°å½±åèé度åæ ¢çã æ°æ®åºç»æ设计ä¹ä¼å½±åå° MySQLï¼ä¾å¦ï¼MySQL 并ä¸æ¯æå¤é®ï¼foreign keyï¼ãè¿ä¸ªç¼ºç¹ä¼å½±åå°ä½ çæ°æ®åºè®¾è®¡ä»¥åç½ç«çæçã对äºä½¿ç¨ MySQL åæ°æ®åºçç½ç«ï¼ä½ åºè¯¥æ³¨æçæ¯ï¼å¦ä½è®©ç¡¬çååIOåå°å°æä½å¼ãå¦ä½è®©ä¸ä¸ªæå¤ä¸ª CPU éæ¶ä¿æå¨é«éä½ä¸çç¶æã以åéå½çç½ç»å¸¦å®½ï¼ èéå®é ä¸çæ°æ®åºè®¾è®¡ä»¥åèµææ¥è¯¢è¯å¥ãäºå®ä¸ï¼æäºç½ç«å¼åè å° MySQL 称为ç®åå¸é¢ä¸è·å¾æå¿«çæ°æ®åºãä¸è¿ï¼å½ä½ çæ°æ®åºæå¾å¤è¡¨æ ¼éè¦åæ¶å¨ä¸ä¸ªäºå¡è¿ç¨ï¼transactionï¼å å®ææ´æ°çæ¶åï¼MySQL çç¡®è·å¾ä¸æä¹æ ·ã
·å¤ä»½
å¦æä½ æ¾ç»æè¿æ¢æä¸ä¸ªæåç MDB æ¡£æ¡çæ¨çç»éªï¼é£ä¹ä½ ä¼å¯¹ MySQL 表示é常æ¿èµãè¿æ¯ MySQL å¦ä¸ä¸ªèè¿ Access çå°æ¹ãé¦å ï¼mysqldump ä¼äº§çä¸ä¸ªæ¯ Access 好å¾å¤èä¸ä¹æ´å¯é çå¤ä»½æ¡£æ¡ãç¸æ¯ä¹ä¸ï¼å¨ Accessä¸ä½ åªæ¯å°ä¸ä¸ª MDB æ¡£æ·è´èµ·æ¥åå¤ä»½ãå ¶æ¬¡ï¼å³ä½¿ MySQL çå¤ä»½æé¨åæåï¼å¤åèµ·æ¥ä¹è¦æ¯ä¸ä¸ªæåç MDB æ¡£è¦å®¹æå¾å¤äºã
·å¯å»¶ä¼¸æ§ï¼Scalabilityï¼ä»¥åèµæå¤çè½å
å¥å¥ç»å±±è çè¯æ¥è¯´ï¼å° Access æ°æ®åºæ¥è· MySQL ç¸æ¯ï¼ç®ç´å°±æ¯åæå°ç¬¬å®é£çå°å±±ä¸æ¿æ¥è·ç§ç½æå¤æ´ç¶å±±èç Pike's Peak 顶ç¸æ¯è¾ãäºå®å°±æ¯è¿ä¹ç®åâ¶MySQL å¯ä»¥å¤ççæ¡£æ¡æ¯ Access æè½å¤ççæ¡£æ¡å¤§å¾å¤ãå¦æä½ ç¡¬å° Access æ°æ®åºå¼å° 100MB ç MDB æ¡£æ¡æ¶ï¼ä½ è¦åå¤å¥½ä¸ä¸ªåå ¸åç纪å½æ¬æ¥è®°å½æ¥èªå®¢æ·å¯¹äºç½ç«æçä½ä¸çæ±æ¨ãè类似çæ°æ®åºå¨ MySQL ä¸é¢è·ï¼å°±ä¸ä¼åçæ¿è½½è¿éç迹象ã
å¦å¤ï¼MySQL åæ¶æä¾é«åº¦å¤æ ·æ§ï¼è½å¤æä¾å¾å¤ä¸åç使ç¨è ä»é¢ï¼å æ¬å½ä»¤è¡å®¢æ·ç«¯æä½ï¼ç½é¡µæµè§å¨ï¼ä»¥ååå¼åæ ·çç¨åºè¯è¨ä»é¢ï¼ä¾å¦ C+ï¼Perlï¼Javaï¼PHPï¼ä»¥å Pythonãä½ å¯ä»¥ä½¿ç¨äºå å è£ å¥½ç客æ·ç«¯ï¼æè å¹²èèªå·±åä¸ä¸ªåéçåºç¨ç¨åºãMySQL å¯ç¨äº Unixï¼Windowsï¼ä»¥å OS/2 çå¹³å°ï¼å æ¤å®å¯ä»¥ç¨å¨ä¸ªäººçµèæè æ¯æå¡å¨ä¸ã
没éï¼Microsoft ActiveX Data Objects Libraryï¼ADOï¼çç¡®ä½¿å¾ Access å¨å¤é¨èµæå¸åºï¼foreign data marketï¼ä¸è½å¤åæ´å ·å¼¹æ§çåºç¨ãå®è½å¤è®©ä½ ä¸ç¨ç®¡èµæçæå¨ä½ç½®èååºèµæï¼ç¶åå¨å ¬ç¨çä»é¢ä¸ï¼å³ç½é¡µæµè§å¨ï¼å°èµææ¾ç¤ºåºæ¥ãä¸è¿ï¼å ¶åå¤æ¯ ADO æ¯ç«æ¯æ¯è¾ç¬¨éï¼å®æ¬èº«å°±æ¯ä¸ªèµæºå¤§æç©ï¼èä¸å¦ä¹ å®è¦è±ä¸å°çéé±è·æ¶é´ï¼å°±ç®ä½ æ¯ä¸ä¸ªè½åä¸éçå¼åå·¥ç¨å¸æè 软件工ç¨å¸ä¹ä¸æ ·ã没æ人è½å¨ä¸å¤©å å° ADO å¦ä¼ã
â²å¦ä¹ æ²çº¿
å¦æä½ å·²ç»çææ°æ®åºææ¯ï¼é£ä¹åºæ¬ä¸ä½ å·²ç»æ²¡ä»ä¹é®é¢äºãç²¾éæ°æ®åºç人å¨ä¸å¤©ä¹å å°±å¯ä»¥æ MySQL å¦ä¼ï¼æè¿ä¸ªç»éªå å°ä»çå±¥å表éé¢å»ãç¸è¾ä¹ä¸ï¼Access æ¯ä¸ªå¤æå¾å¤çæ°æ®åºåå¼åå·¥å ·ãå³ä½¿æ¯ä¸ä¸ªè½åä¸éçå¼åå·¥ç¨å¸ä¹éè¦ä¸æ®µæ¶é´æè½å ·å¤è¶³å¤çä¸ä¸ç¥è¯ï¼ææå°ä½¿ç¨è¿ä¸ªè½¯ä»¶ã
æ£å¦ä½ æå¾ çï¼MySQL æ¯æç»æåæ¥è¯¢è¯è¨ï¼Structured Query Language ,SQLï¼ãå¦æä½ å·²ç»å¦ä¼æç§çæ¬ç SQL è¯è¨ï¼äºæ ä¼å¥½åå¾å¤ãå ·æ VB æè æ¯ VBA ç¥è¯èæ¯çå¼åå·¥ç¨å¸ä¼åç°ï¼ä»ä»¬ä»¥åæå ·å¤ç ASP èæ¯ï¼è½å¤å¸®å©ä»ä»¬ç¼©çå¦ä¹ æ¶é´ã
â²å®¢æ·æ¯æ
è½ç¶å¥½ç¨èä¸å è´¹ç客æ·æ¯æå·²ä¸åå¨ï¼ç¶èMySQL åæä¾äºä¸äºçµå群ç»ååä¾æ¨åèãæä¸äºæ¯é¢å ·ææ¯æ§çï¼èä¸ä¼å们å¾å¾äºç¸æä¾æä½³ç客æ·æ¯æ -- ä»ä»¬å½¼æ¤å享ç»éªåä¸ä¸ç¥è¯ãæ¤å¤ï¼ä½ è¿å¯ä»¥è´ä¹°å ·æ 客æ·æ¯æ ççæ¬ï¼å æ¬ email æ¯ææè çµè¯æ¯æçæ¹å¼ã大è´ä¸æ¥è¯´ï¼å®¢æ·æ¯æè´¹ç并éåºå®çï¼å æ¤æ们æ æ³æä¾ä½ ç¸å ³ä»·ä½çä¿¡æ¯ã
â²MySQL çä¸è¶³ä¹å¤
Access æ¯ä¸ä¸ªå ³èæ§æ°æ®åºç®¡çç³»ç»ï¼RDBMSï¼ï¼ç¶è MySQL 并éå¨æ¯ä¸ä¸ªå±é¢é½æ¯å¦æ¤ãè¿è¡¨ç¤ºï¼è½ç¶ MySQL å¾å¥½ç¨ï¼å®è¿ä¸æ¯æ好çã 以ä¸å表记å½äºç®åå ³èæ§å±é¢ä»¥å管çå±é¢ï¼MySQL å°æªæ¯æçé¨å:
MySQL 没æ³å¤çå¤æçå ³èæ§æ°æ®åºåè½ï¼ä¾å¦ï¼åæ¥è¯¢ï¼subqueriesï¼ï¼è½ç¶å¤§å¤æ°çåæ¥è¯¢é½å¯ä»¥æ¹åæ joinãæ们æå¾ ä¸ä¸çåºæ¥æ¶ï¼è¿é¡¹åè½ä¼è¢«å è¿æ¥ã
å¦ä¸ä¸ª MySQL 没ææä¾æ¯æçåè½æ¯äºå¡å¤çï¼transactionï¼ä»¥åäºå¡çæ交ï¼commitï¼/æ¤éï¼rollbackï¼ã ä¸ä¸ªäºå¡æçæ¯è¢«å½ä½ä¸ä¸ªåä½æ¥å ±åæ§è¡çä¸ç¾¤æä¸å¥å½ä»¤ãå¦æä¸ä¸ªäºå¡æ²¡æ³å®æï¼é£ä¹æ´ä¸ªäºå¡éé¢æ²¡æä¸ä¸ªæ令æ¯çæ£æ§è¡ä¸å»çã对äºå¿ é¡»å¤ç线ä¸è®¢åçåä¸ç½ç«æ¥è¯´ï¼ MySQL 没ææ¯æè¿é¡¹åè½ï¼ç确让人è§å¾å¾å¤±æã ä½æ¯å¯ä»¥ç¨MaxSQLï¼ä¸ä¸ªåå¼çæå¡å¨ï¼å®è½éè¿å¤æçè¡¨æ ¼æ¥æ¯æäºå¡åè½ã
å¤é®ï¼foreign keyï¼ä»¥ååèå®æ´æ§éå¶ï¼referential integrityï¼å¯ä»¥è®©ä½ å¶å®è¡¨æ ¼ä¸èµæé´ç约æï¼ç¶åå°çº¦æï¼constraintï¼å å°ä½ æè§å®çèµæéé¢ãè¿äºMYSQL没æçåè½è¡¨ç¤ºä¸ä¸ªæèµå¤æçèµæå ³ç³»çåºç¨ç¨åºå¹¶ä¸éåä½¿ç¨ MySQLã å½æ们说 MySQL ä¸æ¯æå¤é®æ¶ï¼æ们æçå°±æ¯æ°æ®åºçåèå®æ´æ§éå¶ -- MySQL 并没ææ¯æå¤é®çè§åï¼å½ç¶æ´æ²¡ææ¯æè¿éå é¤ï¼cascading deleteï¼çåè½ã ç®çç说ï¼å¦æä½ çå·¥ä½éè¦ä½¿ç¨å¤æçèµæå ³èï¼é£ä½ è¿æ¯ç¨åæ¥ç Access å§ã
ä½ å¨ MySQL ä¸ä¹ä¸ä¼æ¾å°åå¨è¿ç¨ï¼stored procedureï¼ä»¥å触åå¨ï¼triggerï¼ãï¼é对è¿äºåè½ï¼å¨ Access æä¾äºç¸å¯¹çäºä»¶è¿ç¨ï¼event procedureï¼ãï¼
Access ç GetRows åè½ï¼æä¾äºè¾å¥½çèµææ¾åã
温馨提示:答案为网友推荐,仅供参考