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

[[email protected] ~]# /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyyyy variables |grep max_connections

2.修改最大连接数为200

[[email protected] ~]# nano /etc/my.cnf

输入以上命令后会进入my.cnf文件内容,在其中加入下面这行代码

max_connections=200

使用上下箭头移动光标,输入后按ctrl+o组合键后保存,保存的时候要再按回车键确定的,确定后按ctrl+x组合键退出回到命令行

3.最后一步就是重启mysql [[email protected] ~]#  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 [[email protected] ~]# /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyy variables |grep max_connections | max_connections                         | 10

| [[email protected] ~]# nano /etc/my.cnf

[[email protected] ~]# /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‘

[[email protected] ~]# 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.                                            [确定]

[[email protected] ~]# /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                                                                                       |

[[email protected] ~]# 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

时间: 2024-11-08 06:39:47

Linux下修改Mysql最大并发连接数的相关文章

linux下修改MySQL root密码后数据库消失

Linux系统下如果没有通过password()函数修改mysql的root密码就会导致mysql数据库消失.有些人可能不知道而直接修改了mysql的root密码,于是产生了mysql数据库消失的问题,这个时候该怎么处理呢? 可以用下面的办法解决: 1.修改mysql数据库目录配置文件:my.cnf(或my.ini) [mysqld]下添加: skip-grant-tables 2.重启mysql服务,然后用mysql 登录. 3.进入后,可以看到,mysql数据库已呈现,然后修改密码: upd

phpmyadmin登录报错外加linux下修改mysql登录密码

1.centos6.5中修改mysql的登录密码. [[email protected] ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 报错信息, 解决办法: [[email protected] ~]# /etc/init.d/mysqld stop 停止 mysqld:              

linux下修改mysql数据库编码后无法启动解决办法

linux下老版本的Mysql修改数据库编码的方法是 修改my.cnf vi /etc/my.cnf 在[client]下添加 default-character-set=utf8 在[mysqld]下添加 default-character-set=utf8 在新的版本中如果这样修改的话,会造成无法启动的错误,结果方法是 在[mysqld]下把default-character-set=utf8换成 重启mysql可以使用 sudo /etc/init.d/mysql restart 注意修改

Linux下修改MySQL编码的方法

有时候因为编码需要修改mysql的编码,windows下修改有图文界面简单一些,linux大家就可以参考下面的方法 默认登录mysql之后可以通过SHOW VARIABLES语句查看系统变量及其值. mysql> show variables like '%character%'; 说明:以下是在CentOS-6.2下的设置  (不同的版本可能有些差异,比如文件的位置.但设置的内容应该是一样的) 1. 找到mysql的配置文件,拷贝到etc目录下,第一步很重要 把/usr/share/doc/m

Linux下修改mysql root密码

1.修改MySQL的配置文件(默认为/etc/my.cnf),在[mysqld]下添加一行skip-grant-tables 2.保存配置文件后,重启MySQL服务 service mysqld restart 3.再次进入MySQL命令行 mysql -uroot -p,输入密码时直接回车,进入MySQL数据库输入以下命令: mysql>use mysql;mysql> update user set password=passworD("test") where use

Linux下修改Mysql的用户(root)的密码

一.拥有原来的myql的root的密码:方法一: 在mysql系统外,使用mysqladmin # mysqladmin -u root -p password "test123" Enter password: [输入原来的密码] 方法二: 通过登录mysql系统, mysql> use mysql; mysql> update user set password=password("oracle") where user='root'; mysql&

linux下修改mysql密码

修改的用户都以root为列.一.拥有原来的myql的root的密码: 方法一:在mysql系统外,使用mysqladmin# mysqladmin -u root -p password "test123"Enter password: [输入原来的密码] 方法二:通过登录mysql系统,# mysql -uroot -pEnter password: [输入原来的密码]mysql>use mysql;mysql> update user set password=pass

Linux下修改Mysql的用户(root)的密码(转载)

修改的用户都以root为列.一.拥有原来的myql的root的密码: 方法一:在mysql系统外,使用mysqladmin# mysqladmin -u root -p password "test123"Enter password: [输入原来的密码] 方法二:通过登录mysql系统,# mysql -uroot -pEnter password: [输入原来的密码]mysql>use mysql;mysql> update user set password=pass

【修改密码】Linux下修改Mysql的用户(root)的密码

修改的用户都以root为列.一.拥有原来的myql的root的密码: 方法一:在mysql系统外,使用mysqladmin# mysqladmin -u root -p password "test123"Enter password: [输入原来的密码] 方法二:通过登录mysql系统,# mysql -uroot -pEnter password: [输入原来的密码]mysql>use mysql;mysql> update user set password=pass