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

mysqlµÄһЩ¸ß¼¶Óï¾ä

Ò»,½ñÌì¸ø´ó¼Ò½²Ò»ÏÂ,×öÁôÑÔµÄÒ»ÖÖ×·¼ÓµÄ·½Ê½Ö÷ÒªÈç¹ûµ±Ç°ÓÐÁôÑÔ,¾Í¸üе±Ç°µÄÁôÑÔÒÔ×·¼ÓµÄ·½Ê½,Èç¹ûûÄÜÁôÑԾͽ«ÈëÒ»ÌõеÄ
mysql:insert into `table` (field) values ('$value') on duplicate key update `field`=concat('value',ifnull(`field`,''));
¾ßÌå±¾ÌõSQLµÄÓ÷¨,Çë²é¿´ÊÖ²á
¶þ,½²Ò»ÏÂͳ¼ÆµÄÓ÷¨,Ö÷Òª½éÉÜÈçºÎÓÃÒ»ÌõSQLÓï¾ä,ͳ¼Æij¸öÓû§µÄij¸ö×Ö¶ÎÖв»Í¬×´Ì¬µÄºÏ
Ê×ÏÈ,(select t.username,t.action,count(*) as num from t group by t.username,t.action) as NÓ÷Ö×éµÄ·½Ê½½«²»Í¬µÄÓû§ÖеÄij¸ö×ֶεÄijЩ״̬·Ö×éÇóºÏÕâÊÇ×Ó¾ä
È»ºó,select N.username,max(CASE N.action where 'field1' then n.num else 0 end) as field1_num,max(CASE N.action where 'field2' then n.num else 0 end) as field2_num from ,(select t.username,t.action,count(*) as num from t group by t.username,t.action) as N group by N.username
È»ºó·Ö±ðÏÔʾusername,field1_num,field2_num


Ïà¹ØÎĵµ£º

MySQL½Ì³Ì£ºOrder ByÓ÷¨


ÏÈ°´ÕÕÏÂÃæµÄ±í½á¹¹´´½¨mysql_order_by_testÊý¾Ý±í£¬ÎÒÃÇÓÃʵÀýÒ»µãÒ»µã¸æËßÄ㣬MySQL order byµÄÓ÷¨¡£
¡¡¡¡ORDER BY uid ASC
¡¡¡¡°´ÕÕuidÕýÐò²éѯÊý¾Ý£¬Ò²¾ÍÊÇ°´ÕÕuid´ÓСµ½´óÅÅÁÐ
¡¡¡¡ORDER BY uid DESC
¡¡¡¡°´ÕÕuidÄæÐò²éѯÊý¾Ý£¬Ò²¾ÍÊÇ°´ÕÕuid´Ó´óµ½Ð¡ÅÅÁÐ
¡¡¡¡ÎÒÃÇÀ´¿´
SELECT * from mysql_order_by_test OR ......

MySQL×î»ù´¡ÖªÊ¶¼Ç¼

Ò».°²×°
rpm·½Ê½
rpm -ivf MySQL*
tar·½Ê½
tar xzvf mysql-x.xx.tar.gz
cd mysqlp-x.xx    Éú³Émakefile
./congigure   
make              ±àÒë
 
make install
mysql_install_db
¶þ.Æô¶¯¡¢¹Ø±Õ
ser ......

С̸MySQL×Ö·û¼¯


×÷/ÒëÕߣºÒ¶½ðÈÙ£¨Email: £©£¬À´Ô´£ºhttp://imysql.cn£¬×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
Ê×ÏÈ,ÕâƬÎÄÕ´¿´âÊÇÎҵĸöÈ˾­Ñé̸֮,ÊÊÓÃÓÚÎÒ³£¼ûµÄ»·¾³¼°ÏîÄ¿ÖÐ.
¸öÈ˽¨Òé,Êý¾Ý¿â×Ö·û¼¯¾¡Á¿Ê¹ÓÃutf8(HTMLÒ³Ãæ¶ÔÓ¦µÄÊÇutf-8),ÒÔʹÄãµÄÊý¾ÝÄܺÜ˳ÀûµÄʵÏÖǨÒÆ,ÒòΪutf8×Ö·û¼¯ÊÇÄ¿Ç°×îÊʺÏÓÚÊ ......

shell Öе÷Óà mysql ²Ù×÷

#!/bin/bash
#ɾ³ý100¸öÊý¾Ý¿âÖеÄ1000¸ö±íµÄ¹ýÆÚÊý¾Ý
DBHOST="127.0.0.1"
DBPWD="pwd"
DBUSER="root"
MYSQLBIN="/usr/local/mysql/bin/mysql"
for((dbindex = 0;dbindex < 100;dbindex++))
do
   for((tabindex = 0;tabindex < 10;tabindex++))
   do
    if [&n ......

mysql×Ö·û¼¯ÎÊÌâ

MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
     ×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
     ·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
  MySQL¶ÔÓÚ×Ö·û¼¯µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ