首页 技术 正文
技术 2022年11月17日
0 收藏 658 点赞 4,138 浏览 3523 个字

输入的命令如下:

/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

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,556
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,405
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898