Home > Database > Mysql Tutorial > CentOS下MySQL最大连接数设置 1040 too many connection

CentOS下MySQL最大连接数设置 1040 too many connection

WBOY
Release: 2016-06-07 16:50:29
Original
978 people have browsed it

CentOS下MySQL最大连接数设置 1040 too many connection

CentOS下MySQL最大连接数设置 1040 too many connection

当最大连接数比较小时,可能会出现“1040 too many connection”错误。

可以通过修改配置文件来修改最大连接数,但我连配置文件在哪都不知道,,应该怎么办呢?

首先需要重启mysql服务,执行命令:service mysql restart

也有可能是:service mysqld restart

登录mysql:mysql -uroot -p
输入密码,回车;

登录成功后执行以下语句查询当前的最大连接数:
select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME='MAX_CONNECTIONS';

执行以下语句修改最大连接数:
set global max_connections = 3600;

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL

Ubuntu 14.04下搭建MySQL主从服务器

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb

--------------------------------------分割线 --------------------------------------

本文永久更新链接地址:

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template