²éѯmysqlµ±Ç°Á¬½ÓÊý
1.show status
Threads_connected µ±Ç°µÄÁ¬½ÓÊý
Connections ÊÔͼÁ¬½Óµ½(²»¹ÜÊÇ·ñ³É¹¦)MySQL·þÎñÆ÷µÄÁ¬½ÓÊý¡£
Max_used_connections ·þÎñÆ÷Æô¶¯ºóÒѾͬʱʹÓõÄÁ¬½ÓµÄ×î´óÊýÁ¿¡£
2.set GLOBAL max_connections=Á¬½ÓÊý;
flush privileges
3.ÐÞ¸Ä/etc/my.cnfÖеÄmax_connections
4.show processlist ÏÔʾµ±Ç°ÕýÔÚÖ´ÐеÄmysqlÁ¬½Ó
5.mysqladmin -u<user> -p<pwd> -h<host> status
ÏÔʾµ±Ç°mysql״̬
Uptime: 13131 Threads: 1 Questions: 22 Slow queries: 0 Opens: 16 Flush tables: 1 Open tables: 1 Queries per second avg: 0.1
mysqladmin -u<user> -p<pwd> -h<host> extended-status
ÏÔʾmysqlµÄÆäËû״̬
+-----------------------------------+----------+
| Variable_name | Value |
+-----------------------------------+----------+
| Aborted_clients | 0 |
| Aborted_connects | 1 |
| Binlog_cache_disk_use | 0 |
| Binlog_cache_use | 0 |
| Bytes_received | 1152 |
| Bytes_sent | 10400 |
| Com
Ïà¹ØÎĵµ£º
ʲôÊÇË÷Òý£¿
Ë÷
ÒýÓÃÀ´¿ìËÙµØÑ°ÕÒÄÇЩ¾ßÓÐÌض¨ÖµµÄ¼Ç¼£¬ËùÓÐMySQLË÷Òý¶¼ÒÔB-Ê÷µÄÐÎʽ±£´æ¡£Èç¹ûûÓÐË÷Òý£¬Ö´ÐвéѯʱMySQL±ØÐë´ÓµÚÒ»¸ö¼Ç¼¿ªÊ¼É¨ÃèÕû¸ö±íµÄ
ËùÓмǼ£¬Ö±ÖÁÕÒµ½·ûºÏÒªÇóµÄ¼Ç¼¡£±íÀïÃæµÄ¼Ç¼ÊýÁ¿Ô½¶à£¬Õâ¸ö²Ù×÷µÄ´ú¼Û¾ÍÔ½¸ß¡£Èç¹û×÷ΪËÑË÷Ìõ¼þµÄÁÐÉÏÒѾ´´½¨ÁËË÷Òý£¬MySQLÎÞÐèɨÃèÈκμǼ¼´
¿ ......
MySQL »á×Ô¶¯¶Ï¿ª IDLE ʱ¼ä³¬¹ý 8 СʱµÄÊý¾Ý¿âÁ¬½Ó£¬´Ó¶øµ¼ÖÂһЩ»ùÓÚÊý¾Ý¿âÁ¬½ÓµÄÓ¦ÓóÌÐò£¬ÌرðÊÇ WEB Ó¦ÓóÌÐò³ö´í¡£
ÓÐÁ½¸ö°ì·¨¿ÉÒÔ½â¾öÕâ¸öÎÊÌ⣺
µÚÒ»¸ö°ì·¨ÊÇÐÞ¸Ä MySQL µÄÅäÖòÎÊý¡£Õâ¸ö²ÎÊýµÄÃû³ÆÊÇ wait_timeout
£¬ÆäĬÈÏֵΪ 28800(µ¥Î»Ãë)£¬¸ÕºÃ¾ÍÊÇ 8 Сʱ¡£ÆäÒâÒåΪ¹Ø±ÕÒ»¸öÁ¬½Ó֮ǰÔÚÕâ¸öÁ¬½ÓÉϵ ......
---- ÔÚÊý¾Ý¿âµÄÓ¦Óÿª·¢ÖУ¬³£³£»áÓöµ½ÐÔÄܺʹú¼ÛµÄÖ®¼äì¶Ü¡£ÒÔ×÷ÕßÔÚ¿ª·¢¹ÉÊÐÐÐ
Çé²éѯºÍ½»Ò×ϵͳÖÐÓöµ½µÄÎÊÌâΪÀý£¬ÒªÔÚʵʱ¼Ç¼1000¶àÖ»¹ÉƱÿ·ÖÖÓ¸üÐÂÒ»´ÎµÄÐÐ
ÇéÊý¾ÝµÄͬʱ£¬ÏìÓ¦´óÁ¿²¢·¢Óû§µÄÊý¾Ý²éѯÇëÇ󡣿¼Âǵ½ÐԼ۱ȺÍÒ×ά»¤ÐÔ£¬ÏµÍ³ÓÖ
ÒªÇóÔÚ»ùÓÚPC·þÎñÆ÷£¬Windows NTƽ̨µÄÈíÓ²¼þ»·¾³ÏÂʵÏÖ¡£¿ª ......
ÏñPHPºÍperlÒ»Ñù£¬MySQLÒ²ÌṩµÄCÓïÑÔʹÓõÄAPI. C´úÂëµÄAPIÊÇËæMySQLÒ»Æð·¢²¼µÄ¡£ Ëü°üº¬ÔÚmysqlclient¿âÖУ¬ ¿ÉÒÔʹC³ÌÐòÀ´·ÃÎÊÊý¾Ý¿â¡£
MySQLÔ´Âë°üÖеÄÐí¶à¿Í»§¶Ë¶¼ÊÇÓÃCдµÄ¡£ Èç¹ûÄãÕýÔÚÕÒʹÓÃÕâЩC APIµÄÀý×Ó£¬ ¿ÉÒÔ¿´¿´¿Í»§¶ËµÄд·¨¡£Äã¿ÉÒÔÔÚMySQLÔ´Âë°üµÄclientsĿ¼ÕÒµ½ÕâЩÀý×Ó¡£
& ......
QT DataBase SQL Explorer
1¡¢°²×°MySQLµ½¹Ù·½ÍøÕ¾ÏÂÔØMySQLÊý¾Ý¿â£¬·Ç°²×°°æ£¬Ö±½ÓÔËÐÐmysqld½ø³Ìǰ̨µÄ
2¡¢Ìí¼Óϵͳ»·¾³±äÁ¿£¬Path+=':\mysql\bin'µÄpath£¬ÔÙÔÚ¿ªÊ¼ÔËÐУ¬CMD->mysql -uroot µÇ¼µ½mySQLÊý¾Ý¿â
Default passwordûÓеģ¬ÓеĻ° mysql -uroot -pÊäÈëÃÜÂ룻ÍøÂçµÇ¼£ºmysql -h ip ......