MysqlʹÓÃ×ܽá
±ÏÒµÉè¼ÆµÄ³ÌÐòÖ÷Ìå±àºÃÁË£¬ÔËÐÐÉÙÁ¿Êý¾ÝûÓÐÈκÎÎÊÌ⣬һµ©Êý¾ÝÁ¿Ôö¼Óµ½22w£¬ÔËÐÐʱ¼ä¾Í³¤µÃÁîÈË·¢Ö¸¡£µ¼Ê¦½¨Ò飬³ÌÐòÖо¡¿ÉÄܵؼõÉÙÓëÊý¾Ý¿â½»»¥µÄ´ÎÊý£¬¾¡¿ÉÄܵذѹ¤×÷¶ª¸øÊý¾Ý¿âÍê³É¡£ÔÚÕâһ˼ÏëµÄÖ¸µ¼Ï£¬ÎÒÈýÌì´ó·ùÐ޸ijÌÐò£¬²¿·Ö´úÂ뼸ºõÊÇ·ÐÂÁËÒ»±é¡£×ܵÄÀ´Ëµ£¬ÔËÐÐʱ¼äȷʵµÃµ½Á˺ܴóµÄ¸ÄÉÆ£¬°ÑÕâÈýÌìµÄ¾Ñé×ܽáһϡ£
1¡¢update²Ù×÷
ʹÓÃpreparestatementÒÔbatch·½Ê½Ìá½»¡£Ä³¸ö²Ù×÷µÄÔËÐÐʱ¼ä´Ó12minËõ¼õµ½82s¡£
2¡¢½¨Á¢Ë÷Òý
Èç¹ûʹÓÃselect from whereµÄ²Ù×÷£¬Ò»¶¨ÒªÎªwhereºóµÄÊôÐÔ½¨Á¢Ë÷Òý¡£·ñÔòÔÚ´ó±íÉϽøÐд˲Ù×÷£¬Ê±¼ä·Ç³£³¤¡£Èç¹ûÓÃ
show processlist²é¿´£¬·¢ÏÖqueryµÄ״̬³¤Ê±¼äÍ£ÁôÔÚsending data¡£ËùÒÔ½¨Ë÷ÒýºÜÖØÒª¡£
3¡¢distinct
×îºÃ²»ÒªÓÃdistinct²Ù×÷£¬·Ç³£ºÄʱ¡£ÎÒ×î³õµÄ´æ´¢¹ý³Ì¼°´úÂëÀ¶¼¶à´ÎÓõ½select count(distinct attribute)£¬Ê¹µÃqueryÖ´
ÐеÄʱ¼ä·Ç³£³¤¡£ÍøÉÏÓн¨Ò飬Èç¹ûÓï¾äΪ select count(distinct attribute) from table_name where,¿ÉÒÔÓÅ»¯Îª
select count(distinct attribute) from (select attribute from table_name where ) as t£¬ tÊÇtable_nameµÄ±ðÃû¡£
4¡¢´æ´¢¹ý³Ì
ÓαêÉêÃ÷ºó£¬Ã»Óдò¿ªÊ±£¬²»ÄÜʹÓÃselect into²Ù×÷£¬ÓнâÊÍ˵select intoÆäʵÊÇÒ»¸öÒþʽÓαꡣËùÓÐÎÒ Ö»ºÃ°Ñselect intoд½ø
ÁËÓαêµÄÑ»·Àï¡£µÈÏÂÒªÔÙÊÔÒ»ÊÔ£¬ÔÚopen cursorºÍfetchÖ®¼ä£¬Ð´Èëselect into£¬¿´ÊÇ·ñÄܹ»³É¹¦¡£
&nbs
Ïà¹ØÎĵµ£º
¸Õ¿ªÊ¼²Ù×÷Êý¾Ý¿âʱÎÒÒ»°ãÊDz»Ê¹ÓÃʲôgui¹¤¾ßµÄ£¬ÎÒÊÇÖ±½ÓʹÓÃcmdϲÙ×÷µÄ£¬¸Ð¾õÓÃÆðÀ´Ò²Í¦²»´íµÄ¡£
×î½ü¿´µ½ÓÐgui¹¤¾ßÄÇÒ²²»´í°¡£¬¾ÍÏÂÀ´Ê¹ÓÃһϣ¬ÎÒϲ»¶ÏµÄÊÇѹËõ°üÃâ°²×°µÄ£¬ÕâÑù¸Ð¾õ±È½ÏÊæ·þ°¡
´ò¿ª²éѯ¹¤¾ßÊǾ¹È»³ö´íÁË£¬²»¹ýÄÜÕý³£Ê¹Óõģ¬µ±Ê±Ò²Ã»ÓÐ×¢Ò⣬½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂ
Ó¦¸ÃÊÇmysqlqb_functions.xml¼ÓÔØ ......
Ò»¡¢Êýѧº¯Êý
ABS(x) ·µ»ØxµÄ¾ø¶ÔÖµ
BIN(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØxµÄ¶þ½øÖÆ£¨OCT·µ»Ø°Ë½øÖÆ£¬HEX·µ»ØÊ®Áù½øÖÆ£©
CEILING(x)   ......
1.ÏÂÔØ MySQL 6.0Ãâ°²×°°æ
http://dev.mysql.com/get/Downloads/MySQL-6.0/mysql-noinstall-6.0.9-alpha-win32.zip/from/pick#mirrors
2.½« MySQL6.0 ½âѹµ½´ý°²×°Ä¿Â¼(×Ô¼º¾ö¶¨·Åµ½ÄÄ£©¡£½âѹºóĬÈÏÎļþ¼ÐÃû³ÆΪ£ºmysql-6.0.9-alpha-win32£¨µ±È»¿ÉÒÔ×Ô¼º¸ü¸Ä£©£¬È»ºóÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¨ÕâÑù£¬ÒÔºó¿ÉÒÔÓÃ%MYSQL ......
1¡¢ÏÔʾÊý¾Ý¿âÁÐ±í£º
show databases;
¸Õ¿ªÊ¼Ê±²ÅÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£mysql¿âºÜÖØÒªËüÀïÃæÓÐMYSQLµÄϵͳÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊÇÓÃÕâ¸ö¿â½øÐвÙ×÷¡£
2¡¢ÏÔʾ¿âÖеÄÊý¾Ý±í£º
use mysql£» //´ò¿ª¿â
show tables;
3¡¢ÏÔʾÊý¾Ý±íµÄ½á¹¹£ ......
֮ǰװ¹ýÒ»±é MySQL 5.1£¬Í¬ÑùµÄ msi °²×°Îļþ£¬Ð¶ÔØ MySQL Ö®ºó¹ý¼¸ÌìÖØÐÂ×°È´Ôõô¶¼²»ÐС£
°²×°ºÃÁËÖ®ºóÅäÖà MySQL ʵÀýµÄʱºòµ½µÚÈý²½“Start Service”Ôõô¶¼¹ý²»È¥£¬³¢ÊÔ×Ô¼ºÆô¶¯·þÎñ»òÕßÓÃÃüÁîÐÐÆô¶¯£¬¶¼Ê§°Ü£»ÉÏÍøÕÒÁËһϣ¬±ðÈËÒ»°ã¶¼Ëµ my.ini ÓÐÎÊÌ⣬³¢ÊÔÁËÒ²²»¹ÜÓá£
ÔÙ´ÎÖØ×°µÄʱºò£¬ÎÞÒâÖп´¼ûÓÐ ......