¾ßÓиºÔؾùºâ¹¦ÄÜMySQL·þÎñÆ÷¼¯Èº²¿ÊðʵÏÖ
À´×Ô£ºhttp://it.china-b.com/zx/linuxsjk/20090525/24129_1.html
ÕªÒª£ºMySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â
ÖÎÀíϵͳ£¬ÊÊÓÃƽ̨¶à£¬¿ÉÀ©Õ¹ÐÔÇ¿¡£ÔÚʵ¼ÊÉú²ú»·¾³ÖУ¬²¿ÊðºÍʵÏÖ¾ßÓÐÒ»¶¨¸ºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷¼¯Èº£¬¶ÔÓÚÌá¸ßÓû§Êý¾Ý¿â
Ó¦ÓÃϵͳµÄÐÔÄÜ¡¢ËٶȺÍÎȶ¨ÐÔ¾ßÓÐÃ÷ÏÔµÄ×÷Óᣱ¾ÎļòÒª½éÉÜÁËÔÚFreeBSD 7.0-ReleaseϵͳÉϲ¿ÊðʵÏÖMySQL·þÎñÆ÷¼¯ÈºµÄ·½°¸£¬²¢¶Ô¿ÉÄܳöÏÖµÄÎÊÌâÌṩÁËÏàÓ¦µÄ½â¾ö·½·¨¡£
1. ÒýÑÔ
MySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̡߳¢¿ª·ÅÔ´´úÂ룬½¨Á¢ÔÚ¿Í»§/·þÎñÆ÷½á¹¹ÉϵĹØϵÐÍÊý¾Ý¿â
ÖÎÀíϵͳ¡£ËüʼÓÚ1979Ä꣬×î³õÊÇMichael WideniusΪÈðµäTcX¹«Ë¾´´½¨µÄUNIREGÊý¾Ý¿â
ϵ
ͳ£¬µ±Ê±µÄUNIREGûÓÐSQL½Ó¿Ú£¬ÏÞÖÆÁËËüµÄÓ¦Óá£1996Äê5Ô£¬Widenius¿ª·¢³öÁËMySQLµÄ×î³õ°æ±¾£¬¿ªÊ¼ÔÚInternetÉϹ«¿ª
·¢ÐС£MySQLµÄ¿ª·¢ÈËÔ±´ÓÒ»¿ªÊ¼¾ÍÒ»Ö±¹Ø×¢ËüµÄÐÔÄÜ£¬Îª´Ë²»Ï§ÌØÐÔ¼¯£¬Ö±µ½½ñÌ죬MySQLÒÀÈ»±£³Ö±¾É«£¬ÒÔ¸ßËٶȸßÐÔÄÜΪÊ×ÒªÔÔò¡£Ëæ×Åʱ¼äµÄÍÆ
ÒÆ£¬MySQLÒ²¼ÓÈëÁË´óÐÍÊý¾Ý¿â
²úÆ·µÄ¸ß¼¶ÌØÐÔ£¬Èç´æ´¢¹ý³Ì¡¢ÊÓͼ¡¢´¥·¢Æ÷µÈ£¬Ê¹ÆäÔÚÆóÒµ¼¶Êý¾Ý¿â
ϵͳÖпªÊ¼±»²¿ÊðÓ¦Óá£2008Äê10Ô£¬SUN¹«Ë¾ÊÕ¹ºÁËMySQL AB¹«Ë¾£¬¿ªÊ¼½øÈ뿪ԴÁìÓò¡£Ëæ×ÅÖØÁ¿¼¶²Ù×÷ϵͳSolarisµÄ¿ªÔ´£¬SUN MySQLÔÚÊý¾Ý¿â
Êг¡Õ¼Óеķݶ»á½øÒ»²½Ìá¸ß¡£Òò´Ë£¬ÔÚÉú²ú»·¾³Öв¿Êð¾ßÓиºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷¼¯Èº£¬¶ÔÓÚÌá¸ßÆóÒµÊý¾Ý¿â
Ó¦ÓÃϵͳµÄËٶȡ¢Îȶ¨ÐÔ¼°¿ÉÉìËõÐÔ¾ßÓкܴóµÄÏÖʵÒâÒ壬Ҳ¿ÉÒÔÓÐЧ½µµÍÓ¦ÓÃϵͳµÄͶ×ʳɱ¾¡£±¾ÎĽ«ÒÔFreeBSD 7.0-Release²Ù×÷ϵͳΪÀý£¬ÀûÓÃMySQLÊý¾Ý¿â
µÄ¸´ÖÆÌØÐÔ£¬¼òÒª½éÉܲ¿ÊðMySQL·þÎñÆ÷¼¯ÈºµÄʵÏÖ·½·¨ºÍÏà¹Ø×¢ÖØÊÂÏî¡£
¡¡¡¡2. ϵͳģÐÍ
±¾¼¯ÈºµÄ½á¹¹ÎªÒ»¸öÖ÷MySQL·þÎñÆ÷·þÎñÆ÷Óë¶à¸ö´ÓÊôMySQL·þÎñÆ÷½¨Á¢¸´ÖÆÁ¬½Ó£¬Ö÷·þÎñÆ÷Óë´ÓÊô·þÎñÆ÷ʵÏÖÒ»¶¨³Ì¶ÈÉϵÄÊý¾Ýͬ²½£¬¶à¸ö´ÓÊô·þÎñÆ÷´æ´¢ÏàͬµÄÊý¾Ý¸±±¾£¬ÊµÏÖÊý¾ÝÈßÓ࣬ÌṩÈÝ´í¹¦ÄÜ¡£²¿Ê𿪷¢Ó¦ÓÃϵͳʱ£¬¶ÔÊý¾Ý¿â
²Ù×÷´úÂë½øÐÐÓÅ»¯£¬½«Ð´²Ù×÷¶¨Ïòµ½Ö÷·þÎñÆ÷£¬°Ñ´óÁ¿µÄ²éѯ²Ù×÷¶¨Ïòµ½´ÓÊô·þÎñÆ÷£¬ÊµÏÖ¼¯ÈºµÄ¸ºÔؾùºâ¹¦ÄÜ¡£¼ÙÈçÖ÷·þÎñÆ÷·¢Éú¹ÊÕÏ£¬´ÓÊô·þÎñÆ÷½«×ª»»½ÇÉ«³ÉΪÖ÷·þÎñÆ÷£¬Ê¹Ó¦ÓÃϵͳΪÖÕ¶ËÓû§Ìṩ²»¼ä¶ÏµÄÍøÂç·þÎñ;Ö÷·þÎñÆ÷»Ö¸´ÔËÐк󣬽«Æäת»»Îª´ÓÊô·þÎñÆ÷£¬´æ´¢Êý¾Ý¿â
¸±±¾£¬¼ÌÐø¶ÔÖÕ¶ËÓû§ÌṩÊý¾Ý²éѯ¼ìË÷·þÎñ¡£
3. ²¿ÊðʵÏÖ
±¾ÎÄÒÔһ̨Ö÷·þÎñÆ÷´øÈý̨´ÓÊô·þÎñÆ÷ΪÀý£¬¼òÒª½éÉÜMySQL·þÎñÆ÷¼¯ÈºµÄʵÏÖ·½°¸ºÍ¾ßÌå·½·¨²½Öè¡£
3.1 ϵͳ²¿
Ïà¹ØÎĵµ£º
´ÓÓû§µÄ½Ç¶È¿´£¬MySQL±»SunÊÕ¹º£¬ÓÖ±»OracleÊÕ¹º¿ÉÄÜÕæ²»ÊÇʲôºÃÊ¡£MySQL±¾À´¾Í±»Oracleͨ¹ý²¢¹ºÆäÒÀÀµµÄ´æ´¢ÒýÇæInnobase¡¢BerkeleyDBÕÛÌڵIJ»ÐУ¬ÓÖÔÚ±»SunÊÕ¹ººó·¢ÉúÁËMonty´´½¨Ð·ÖÖ§MariaDBÕâÑùµÄÊÂÇ飬×îÖÕ»¹ÊÇËæ×ÅSunÒ»Æð±»Oracle²¢¹º£¬Ã»ÓÐÌÓÍÑLarry ElisonµÄħצ¡£Ò²Ðí£¬¿ªÔ´Èí¼þµÄºÃ´¦¾ÍÔÚ ......
Ò»¡¢MySQL »ñµÃµ±Ç°ÈÕÆÚʱ¼ä º¯Êý
1.1 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºnow()
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-08-08 22:20:46 |
+---------------------+
³ýÁË now() º¯ÊýÄÜ»ñµÃµ±Ç°µÄÈÕÆÚʱ¼äÍ⣬MySQL Öл¹ÓÐÏÂÃæµÄº¯Êý£º ......
ÓÃÔÚSELECTºÍWHERE×Ó¾äµÄº¯Êý
--------------------------------------------------------------
1 ·Ö×麯Êý
( ... ) À¨ºÅ¡£Ê¹ÓÃËüÃÇÀ´Ç¿ÖÆÔÚÒ»¸ö±í´ïʽµÄ¼ÆËã˳Ðò¡£
--------------------------------------------------------------
2 ³£ÓõÄËãÊõÔËËã
£¨+ - * /£©
Ò»°ãµÄË ......
MySQL ODBC connection strings
Open connection to local MySQL database using MySQL ODBC 3.51 Driver
"Provider=MSDASQL; DRIVER={MySQL ODBC 3.51Driver}; SERVER= localhost; DATABASE=Your_MySQL_Database; UID= Your_Username; PASSWORD=Your_Password; OPTION=3"
MySQL OLE DB & OleDbConnection (.NET fr ......