mysql查询和修改最大连接数
查看最大连接数: show variables like ‘max_connect%‘;
查看当前连接数: show status like ‘Threads%‘;
修改mysql的连接数:
vim /etc/my.cnf
[mysqld] #设置编码格式 [mysqld] #设置编码格式 character-set-server=utf8 #数据存储目录 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock #开启慢查询 slow_query_log =1 #设置慢查询时间,超过2秒就是慢查询 long_query_time = 2 #慢查询日志文件存储路径 slow_query_log_file=/var/run/mysqld/mysqld-slow.log user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # 将默认的连接数改成500 max_connections = 500 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid [client] default-character-set=utf8 [mysql] default-character-set=utf8
然后重启mysql : service mysqld restart ; (centos6)
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11