MYSQL¼ÆËãÁ½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÌìÊý,ÃëÊý...·ÖÖÓ
#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÌìÊý£º¡¡
To_Days(end_time)-To_Days(start_time)¡¡
#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄÃëÊý£º¡¡
SELECT¡¡UNIX_TIMESTAMP(end_time)-¡¡UNIX_TIMESTAMP(start_time);¡¡
#Á½ÈÕÆÚ/ʱ¼äÖ®¼äÏà²îµÄʱ·ÖÊý£º¡¡
SELECT¡¡SEC_TO_TIME(UNIX_TIMESTAMP(end_time)-¡¡UNIX_TIMESTAMP(start_time));
×îºÃµÄ°ì·¨ÊÇÖ±½ÓÓÓ+”£¬“-” ¼ÆË㣬ĿǰµÄ°æ±¾¶¼Ö§³ÖÁË¡£
±ÈÈ磺SELECT * from Table_Name WHERE loginDate < NOW() -10 * 60;
(thismonth)תÌû£ºhttp://cdcxzw.blog.163.com/blog/static/4976841920095841651405/
Ïà¹ØÎĵµ£º
Ò»¡¢MySQL5.1°²×°
´ò¿ªÏÂÔصݲװÎļþ£¬³öÏÖÈçϽçÃ棺
mysql°²×°Ïòµ¼Æô¶¯£¬µã»÷“next”¼ÌÐø
Ñ¡Ôñ°²×°ÀàÐÍ£¬ÓГTypical£¨Ä¬ÈÏ£©”¡¢“Complete£¨ÍêÈ«£©”¡¢“Custom£¨Óû§×Ô¶ ......
¼¸¸ö³£ÓÃÓÃÀý£º
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.µ¼³öÒ»¸öÊý¾Ý¿â½á¹¹
mysqldump ......
ÒòΪMySQLÔÙdebianÏÂĬÈÏÊDz»ÔÊÐíÔ¶³ÌÁ¬½ÓµÄ£¬ËùÒÔÐèҪעÊ͵ôÕâ¸öÏÞÖÆ¡£ÎÒµÄMySQLÊÇÓÃapt-get°²×°µÄ£¬ËùÒÔ·¾¶ÊÇĬÈϵģ¨Èç¹ûÊÇ×Ô¼º
ÊÖ¶¯°²×°£¬¿ÉÒÔ×Ô¼ºÑ°ÕÒÏÂÕýÈ·µÄ·¾¶£©£¬ÓÃÃüÁî vi /etc/mysql/my.cnf ´ò¿ªÎļþ£¬×¢Ê͵ô bind-address = 127.0.0.1 ±£´æ:wq »Ø³µ¡£
È»ºóÔٵǼµ½MySQL·þÎñÆ÷¶Ë£¬ÔÚmysql¿âÏÂÖ ......
¡¡Õâ´ÎÊÇFotolog
µÄ¾Ñ飬´«ËµÖбÈFlickr¸ü´óµÄÍøÕ¾
£¬FotologÔÚ21̨·þÎñ
Æ÷Éϲ¿ÊðÁË51¸ömemcachedʵÀý£¬×ܼÆÓÐ254G»º´æ¿Õ¼ä
¿ÉÓ㬻º´æÁ˶à´ï175GµÄÄÚÈÝ£¬Õâ¸öÊýÁ¿±ÈºÜ¶àÍøÕ¾µÄÊý¾Ý¿â¶¼Òª´óµÄ¶à£¬ÔÎÄÊÇA Bunch of Great Strategies for Using Memcached and MySQL Better Together
£¬ÎÒÕâÀﻹÊÇÑ¡ÔñÐԵķÒëÒÔ¼°°´ÕÕ ......
ÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
¡¡¡¡mysql> SELECT something from table
¡¡¡¡WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
select TO_DAYS(NOW());
select now() ;
¡¡¡¡DAYOFWEEK( ......