²éѯ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
Ïà¹ØÎĵµ£º
ÒýÓÃhttp://hi.baidu.com/mygf/blog/item/b9f55d60049a2ed58cb10d64.html
2009-10-24 00:23
Ò»£¬»ñÈ¡mysqlÓû§ÏµĽø³Ì×ÜÊý
ps -ef | awk '{print $1}' | grep "mysql" | grep -v "grep" | wc-1
¶þ£¬Ö÷»úÐÔÄÜ״̬
# uptime
[root@ ~]# uptime
13:05:52 up 53 days, 52 min, 1 user, l ......
ʲôÊÇË÷Òý£¿
Ë÷
ÒýÓÃÀ´¿ìËÙµØÑ°ÕÒÄÇЩ¾ßÓÐÌض¨ÖµµÄ¼Ç¼£¬ËùÓÐMySQLË÷Òý¶¼ÒÔB-Ê÷µÄÐÎʽ±£´æ¡£Èç¹ûûÓÐË÷Òý£¬Ö´ÐвéѯʱMySQL±ØÐë´ÓµÚÒ»¸ö¼Ç¼¿ªÊ¼É¨ÃèÕû¸ö±íµÄ
ËùÓмǼ£¬Ö±ÖÁÕÒµ½·ûºÏÒªÇóµÄ¼Ç¼¡£±íÀïÃæµÄ¼Ç¼ÊýÁ¿Ô½¶à£¬Õâ¸ö²Ù×÷µÄ´ú¼Û¾ÍÔ½¸ß¡£Èç¹û×÷ΪËÑË÷Ìõ¼þµÄÁÐÉÏÒѾ´´½¨ÁËË÷Òý£¬MySQLÎÞÐèɨÃèÈκμǼ¼´
¿ ......
mysql,mysqldump,µ¼³ö,µ¼³ö±í,ѹËõµ¼³ömysql,mysqlhotcopy,mysql»¹Ô±í
±¾ÎÄÌÖÂÛ MySQL µÄ±¸·ÝºÍ»Ö¸´»úÖÆ£¬ÒÔ¼°ÈçºÎά»¤Êý¾Ý±í£¬°üÀ¨×îÖ÷ÒªµÄÁ½ÖÖ±íÀàÐÍ£ºMyISAM
ºÍ Innodb
£¬ÎÄÖÐÉè¼ÆµÄ MySQL °æ±¾Îª 5.0.22¡£
Ä¿Ç° MySQL Ö§³ÖµÄÃâ·Ñ±¸·Ý¹¤¾ßÓУºmysqldump¡¢mysqlhotcopy
£¬»¹¿ÉÒÔÓà SQL Óï·¨½øÐб¸·Ý£ºBACK ......
Ò»¸ömysqlµÄÁªºÏ²éѯÁÐ×Ó£¬ºÜ»ù±¾µÄ£¬²»¹ýºÜʵÓá£
ÏÈ¿´Êý¾Ý±í¡£Êý¾Ý±íclass£º
-------------------------------
id cname
-------------------------------
1 ÄÐ×°
2 ŮƤ¿ã
3 Å®²ÊÃÞ
-------------------------------
class±í´æ·ÅµÄÊDzúÆ·µÄ´óÀàà ......
ÖØа²×°£¬³öÏÖ/etc/init.d/mysql: line 115: /etc/mysql/debian-start: ûÓиÃÎļþ»òĿ¼
invoke-rc.d: initscript mysql, action "start" failed.
ʹÓÃÃüÁsudo aptitude purge mysql-server mysql-server-5.0
È»ºóÔÚÖØа²×°....
apt-get install mysql-server-5.0 ......