Linux下修改Mysql最大并发连接数
输入的命令如下:
/usr/local/mysql/bin/mysqladmin -uroot -pyyyyyy variables |grep max_connections
nano /etc/my.cnf
max_connections=200
service mysql restart
在mysql中最大并发连接数修改方法只要在my.cnf文件加找到max_connections 或修改max_connections 的参考即可了,后面的参数越大就是并发越大了
1.先查看下当前MYSQL的最大连接数 注意,root替换成你的数据库,不过一般默认就是root,password是数据库密码,) 入以上命令后会显示下面的信息,这个是最大连接数是100
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyyyy variables |grep max_connections
2.修改最大连接数为200
[root@localhost ~]# nano /etc/my.cnf
输入以上命令后会进入my.cnf文件内容,在其中加入下面这行代码
max_connections=200
使用上下箭头移动光标,输入后按ctrl+o组合键后保存,保存的时候要再按回车键确定的,确定后按ctrl+x组合键退出回到命令行
3.最后一步就是重启mysql [root@localhost ~]# service mysql restart //重启mysql的命令
LINUX命令界面如下:
Xshell for Xmanager Enterprise 5 (Build 0488) Copyright (c) 2002-2014 NetSarang Computer, Inc. All rights reserved.
Type `help' to learn how to use Xshell prompt. [c:\~]$
Connecting to 203.86.8.114:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'.
WARNING! The remote SSH server rejected X11 forwarding request. Last login: Wed Aug 19 17:25:35 2015 from 61.143.61.19 [root@localhost ~]# /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyy variables |grep max_connections | max_connections | 10
| [root@localhost ~]# nano /etc/my.cnf
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -uroot -pzhengou$%#1980 variables |grep max_connections error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed error: 'Too many connections'
[root@localhost ~]# service mysql restart error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted Shutting down MySQL.. [确定] error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted Starting MySQL. [确定]
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyyy variables |grep max_connections error: Found option without preceding group in config file: /etc/my.cnf at line: 3 Fatal error in defaults handling. Program aborted | max_connections | 151 |
[root@localhost ~]# nano /etc/my.cnf
GNU nano 1.3.12 File: /etc/my.cnf
max_connections=200
# Example MySQL config file for medium systems. # # This is for a system with little memory (32M - 64M) where MySQL plays # an important part, or systems up to 128M where MySQL is used together with # other programs (such as a web server) # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You can copy this option file to one of those # locations. For information about these locations, see: # http://dev.mysql.com/doc/mysql/en/option-files.html # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option.
# The following options will be passed to all MySQL clients [client] [ Read 146 lines ] ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell
Linux下修改Mysql最大并发连接数的更多相关文章
- Linux下修改mysql默认最大连接数
liunx下修改mysql最大连接数(Centos下测试通过)1.查看当前系统下mysql设置的最大连接数方式一.mysqladmin -uroot -p variables |grep max_co ...
- Linux下修改MySQL编码的方法
有时候因为编码需要修改mysql的编码,windows下修改有图文界面简单一些,linux大家就可以参考下面的方法 默认登录mysql之后可以通过SHOW VARIABLES语句查看系统变量及其值 ...
- 如何在Linux下修改Mysql的用户(root)密码
下面给大家分享下在Linux下如何修改Mysql的用户(root)的密码,分两种情况:第一种当拥有原来的mysql的root密码,第二种情况忘记原来的mysql的root的密码. 修改的用户都以roo ...
- Linux下修改MySql的root密码
linux下如何修改Mysql的root密码 今天,忘了mysql下的root密码,想重置一下,但找了多个网站上的方法均有问题,最后参考几家的过程,经过不断尝试获得,终于成功了,下面特将过程分 ...
- linux下修改mysql数据库编码后无法启动解决办法
linux下老版本的Mysql修改数据库编码的方法是 修改my.cnf vi /etc/my.cnf 在[client]下添加 default-character-set=utf8 在[mysqld] ...
- Linux下修改Mysql的用户(root)的密码
修改的用户都以root为列.一.拥有原来的myql的root的密码: 方法一:在mysql系统外,使用mysqladmin# mysqladmin -u root -p password " ...
- Linux下修改Mysql的用户(root)的密码的俩种方法
from:https://www.cnblogs.com/daizhuacai/archive/2013/01/17/2865138.html 修改的用户都以root为列.一.拥有原来的myql ...
- 【修改密码】Linux下修改Mysql的用户(root)的密码
修改的用户都以root为列.一.拥有原来的myql的root的密码: 方法一:在mysql系统外,使用mysqladmin# mysqladmin -u root -p password " ...
- 阿里云linux下修改mysql默认密码(xampp环境)- 原创
1.修改MySQL的登录设置: # vi /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/my ...
随机推荐
- 多线程下使用Jedis
在不同的线程中使用相同的Jedis实例会发生奇怪的错误. 但是创建太多的实现也不好因为这意味着会建立很多sokcet连接,也会导致奇怪的错误发生. 单一Jedis实例不是线程安全的. 为了避免这些问题 ...
- uva 11088 暴力枚举子集/状压dp
https://vjudge.net/problem/UVA-11088 对于每一种子集的情况暴力枚举最后一个三人小组取最大的一种情况即可,我提前把三个人的子集情况给筛出来了. 即 f[S]=MAX{ ...
- hive从查询中获取数据插入到表或动态分区
Hive的insert语句能够从查询语句中获取数据,并同时将数据Load到目标表中.现在假定有一个已有数据的表staged_employees(雇员信息全量表),所属国家cnty和所属州st是该表的两 ...
- linux IP局域网监控工具——iptraf
iptraf iptraf是一款交互式.色彩鲜艳的IP局域网监控工具.它可以显示每个连接以及主机之间传输的数据量.下面是屏幕截图. $ sudo iptraf 安装iptraf: # Centos(基 ...
- fatal: Could not read from remote repository.
fatal: Could not read from remote repository. Please make sure you have the correct access rightsand ...
- xss攻击的分类
1.反射型XSS 原理: 通过在页面上植入恶意链接,诱使用户点击,执行js脚本,所谓反射型XSS就是将用户输入的数据(恶意用户输入的js脚本),“反射”到浏览器执行. 实例: php源码: <? ...
- jstat 简介(2)
jstat命令可以查看堆内存各部分的使用量,以及加载类的数量.命令的格式如下: jstat [-命令选项] [vmid] [间隔时间/毫秒] [查询次数] 注意:使用的jdk版本是jdk8. 类加载统 ...
- 剑指offer--11.数组中出现次数超过一半的数字
unique(), count()函数好用 ---------------------------------------------------------------------- 时间限制:1秒 ...
- O(logn)的意思
T=K*log2(N) 注:2是小2时间T与以2为底的对数成正比.实际上,由于所有的对数都和其他对数成比例(从底数为2转换到底数为10需乘以3.322),我们可以将这个为常数的底数也并入K.由此不必指 ...
- PHP提供的数组比较函数总结
在我们看PHP手册的时候发现,PHP提供了许多数组元素比较的函数,看起来又多又烦又不好记,现在我们来总结一下: sort() — 本函数对数组进行排序,当本函数结束时数组单元将被从最低到最高重新安排. ...