mysql״̬ status
http://blog.163.com/mysqldba@126/blog/static/1315356342009931103834396/
×î½ü¿´ÁË¿´mysqlµÄ״̬±äÁ¿£¬¸Ð¾õºÃ¶à¸úÒÔÇ°×Ô¼ºÏëÏóµÄ²»Ò»Ñù¡£ÎªÁËÒÔºóÄܼ°Ê±·¢ÏÖ×Ô¼ºµÄ´íÎó,¾ÍÏȼÇÏÂÀ´;
http://dev.mysql.com/doc/refman/5.1/en/server-status-variables.html
mysql> show status;
Com_xxx
Óï¾ä¼ÆÊý±äÁ¿±íʾÿ¸öxxx Óï¾äÖ´ÐеĴÎÊý¡£Ã¿ÀàÓï¾äÓÐÒ»¸ö״̬±äÁ¿¡£ÀýÈ磬Com_deleteºÍCom_insert·Ö±ðͳ¼ÆDELETE
ºÍINSERTÓï¾äÖ´ÐеĴÎÊý¡£È»¶ø£¬Èç¹ûÒ»¸ö²éѯµÄ½á¹ûÊÇ´Ó²éѯ»º´æÖеõ½µÄ£¬Õâ»áÔö¼ÓQcache_hits£¬¶ø²»ÊÇCom_select
Connections 4192
ÊÔͼÁ¬½Óµ½(²»¹ÜÊÇ·ñ³É¹¦)MySQL·þÎñÆ÷µÄÁ¬½ÓÊý¡£
Created_tmp_disk_tables 0
·þÎñÆ÷Ö´ÐÐÓï¾äʱÔÚÓ²ÅÌÉÏ×Ô¶¯´´½¨µÄÁÙʱ±íµÄÊýÁ¿
Created_tmp_files 5
mysqld´´½¨µÄÁÙʱÎļþ¸öÊý
Created_tmp_tables 1
·þÎñÆ÷Ö´ÐÐÓï¾äʱÔÚÄÚ´æÉÏ×Ô¶¯´´½¨µÄÁÙʱ±íµÄÊýÁ¿£¬Èç¹ûCreated_tmp_disk_tables½Ï´ó£¬Äã¿ÉÄÜÒªÔö¼Ótmp_table_sizeֵʹÁÙʱ ±í»ùÓÚÄÚ´æ¶ø²»»ùÓÚÓ²ÅÌ¡£
Flush_commands 1
flushµÄÖ´ÐиöÊý
Handler_commit 0
Handler_delete 0
´Ó
±íÖÐdeleteÐеĴÎÊý£¬´Ë²ÎÊýÓë
Com_delete²»Ò»Ñù£¬Ö»ÒªÖ´ÐÐdelete£¬Com_delete¾Í»áÔö¼Ó£¬¶øHandler_deleteÖ»Óе±ÔÚ±íÖÐɾ³ýÁËÐеÄʱºò²ÅÔö¼Ó¡£
Èç¹ûdeleteɾ³ýûÓÐÓ°Ïìµ½±íÀïµÄÈκÎÐУ¬Ôò²»»áÔö¼ÓHandler_deleteÖµ
Handler_discover &n
Ïà¹ØÎĵµ£º
Ò».MYSQLµÄÃüÁîÐÐģʽµÄÉèÖãº
×ÀÃæ->ÎҵĵçÄÔ->ÊôÐÔ->»·¾³±äÁ¿->н¨->
PATH=“£»path\mysql\bin;”ÆäÖÐpathΪMYSQLµÄ°²×°Â·¾¶¡£
¶þ.¼òµ¥µÄ½éÉÜÒ»ÏÂÃüÁîÐнøÈëMYSQLµÄ·½·¨£º
1.C:\>mysql -h hostname -u username -p
°´ENTER¼ü£¬µÈ´ýÈ»ºóÊäÈëÃÜÂë¡£ÕâÀïhostnameΪ·þÎñÆ÷µÄÃû³Æ£¬Èçlocalh ......
ÔÚÁ¬½ÓMySQLʱ£¬¿ÉÒÔ¼ÓÉÏ-b²ÎÊý£¬ÓÃÒÔÈ¡ÏûÔÚSQLÃüÁîÖ´Ðгö´íʱµÄ±¨¾¯Éù£¬È磺
mysql -h127.0.0.1 -uroot -proot -b
ÕâÑùÔÚÊäÈëÃüÁî³ö´íʱ£¬±ã²»»áÔÙÌýµ½ÄÇÉùÄÑÌýµÄ"àÖ"ÁË¡£
ÁíÍ⻹ÓÐ2¸ö¹Ø±ÕMYSQLµÄBEEPÉù·½·¨
1. ʹÓÃMySQLµÄÃüÁîÖÕ¶Ëʱ£¬Èç¹ûÊäÈëSQLÓÐÎ󣬽«ÓÐbeepÉù¡£ÈôÒª¹Ø±Õ¸Ã¹¦ÄÜ£¬¸ù¾Ýmysql --help£¬Ê¹ÓÃmysql - ......
¸´ÖƼǼ,²ÉÓÃ×Ô²éѯ·½Ê½
sql
INSERT INTO `table` ('id','aa','bb','cc') SELECT 'id','aa','bb','cc' from `table` (WHERE .....)
Tips:
/**
* ¸´ÖÆмͼµÄʱºò,¿ÉÄÜÒª¸üÐÂid»òÕßÊDz¿·ÖÊý¾Ý(¼ÙÉèid×ÔÔö¼ÓµÄÇé¿ö)
*
* text_aa Ϊ¹Ì¶¨Öµ ,¿ÉÔڽű¾µ÷ÓÃÖи³±äÁ¿Öµ Èç($aa)
* ×¢Òâ'text_aa' Óë `cc` µÄÇø±ð ......