mysqladmin -uroot -p密码写上 status
输出如下:
Uptime: 9897 Threads: 20 Questions: 15531 Slow queries: 0 Opens: 0 Flush tab
les: 1 Open tables: 61 Queries per second avg: 7.389
------------------------------------------
Threads: 20就是连接数量。
查参数(mysql外):/usr/local/mysql55/bin/mysqladmin -uroot -p variables
查看参数(mysql中):mysql> show variables
设置新的最大连接数为200:mysql> set GLOBAL max_connections=200
显示当前运行的Query:mysql> show processlist
显示当前状态:mysql> show status
截断一个表: truncate table friends;
删除表记录:delete from friends where user_name = ‘simaopig’;
修改表字段:alter table PUSH_MSG_RECORD modify publish_name varchar(512) DEFAULT NULL;
改字段名:alter table 表名称 change 字段名称 字段名称 字段类型 [是否允许非空];
增加字段:alter table table1 add transactor varchar(10) not Null;