¹ØÓÚMySQL ORDER BY
ÓÉÓÚϵͳÐèÒª£¬Ð´ÁËÒ»¸öORDER BY µÄSQL²éѯÓï¾ä½øÐÐ×Ö¶ÎÅÅÐò£¬²éѯ½á¹ûûÓнøÐÐÅÅÐò£¬SQLÓï·¨ÕýÈ·£»
ÓÚÊÇ£¬½øÈëMySQL¿ØÖÆ̨£¬Ö´ÐÐSQLÓï¾ä£¬Ã»Óб¨´í£¬µ«ÊǾÍÊÇûÓÐÅÅÐò£»
¾¹ý²éÕÒ·¢ÏÖ£¬ÔÚд ORDER BY ' time' DESC Óï¾äÖУ¬Ê¹ÓÃÁË“ ' ”·ûºÅ£¬µ¼ÖÂMySQLÎÞ·¨Õý³£½âÎö£¬È¥µôÅÅÐòÕý³££»
»òÕß¿ÉÒÔÓà “`”Õâ¸ö´úÌ棬¼´ ORDER BY ` time` DESC£»
ËäÈ»ÕÒµ½´íÎóÔÒò£¬µ«ÊDz»Öª “`”ºÍ “ ' ”ÔÚSQLÓï¾äÖеÄÇø±ð£¬Ï£ÍûÓÐÖªµÀµÄ¸ßÈËÖ¸µ¼¡£
·Ç³£¸Ðл£¡£¡£¡
Ïà¹ØÎĵµ£º
mysql(°üÀ¨ËùÓÐ5.*ϵÁÐ,5.1.21֮ǰ)µÄÂý²éѯÈÕ־ĬÈÏÊÇÒÔÃëΪµ¥Î»µÄ,¿ÉÒÔͨ¹ýset [session|global] long_query_time=1Õâ¸ö×îµÍÒ²¾ÍÊÇ¿ÉÒÔÉèÖõ½1Ãë,¶ÔÓÚ0.5,0.005Ö®Àà¾ÍÎÞÄÜΪÁ¦ÁË,Õâʱºò¿ÉÒÔÓÐmicroslow patch(msl patch)²¹¶¡À´Íê³ÉÕâÒ»¹¤×÷,Õâ¸ö¹¦Äܵĺô¦×ÔÈ»²»ÑÔ¶øÓ÷.
&nb ......
cacti ¼à¿Ø mysql
»·¾³£º
Cactiez»òÕßcactiÖ÷»ú£º192.168.12.5
±»¼à¿ØmysqlÊý¾Ý¿âÖ÷»ú£º192.168.5.231
1. °²×°¼à¿Ø²å¼þ
cd /opt
wget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.6.tar.gz
tar -xzvf mysql-cacti-templates-1.1.2.tar.gz
cp /opt/mysql-cacti-templates-1.1.2 ......
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñËùÓÐ date_col ÖµÔÚ×îºó 30 ÌìÄڵļǼ¡£
mysql> SELECT something from tbl_name
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
DAYOFWEEK(date) ·µ»Ø date µÄÐÇÆÚË÷Òý(1 = Sunday, 2 = Monday, ... 7 = Saturday)¡£Ë÷ÒýÖµ·ûºÏ ODBC µÄ±ê×¼¡£
mysq ......
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP
µ ......
ÉèÖÃMySQLÊý¾Ýͬ²½£¨µ¥Ïò&Ë«Ïò£©
ÓÉÓÚ¹«Ë¾µÄÒµÎñÐèÇó£¬ÐèÒªÍøͨºÍµçÐŵÄÊý¾Ýͬ²½£¬¾Í×öÁ˸öMySQLµÄË«Ïòͬ²½£¬¼ÇϹý³Ì£¬ÒÔºóÓõõ½ÔÙ·³öÀ´£¬Ò²Ìù³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢×¼±¸·þÎñÆ÷
ÓÉÓÚMySQL²»Í¬°æ±¾Ö®¼äµÄ(¶þ½øÖÆÈÕÖ¾)binlog¸ñʽ¿ÉÄܻ᲻һÑù£¬Òò´Ë×îºÃµÄ´îÅä×éºÏÊÇMasterµÄMySQL°æ±¾ºÍSlaveµÄ°æ±¾Ïàͬ»òÕ߸üµÍ£¬Ma ......