If your startup script is/etc/init. d/MySQL, find $ bindir/safe_mysqld and add the following parameters.
-O max_connections = 1000-O wait_timeout = 500-O interactive_timeout = 500
Of course, you have to modify it based on your actual situation, but the default value is unimaginable for servers with such loads in our company ......
Now, your MySQL startup file may look like this:
............
$ Bindir/safe_mysqld -- user = mysql -- datadir = $ datadir -- pid-file = $ pid_file-O max_connections = 1000-O wait_timeout = 500-O interactive_timeout = 500 &
............
After modification, restart MySQL. Be sure to use the mysqladmin shutdown server first.
We recommend that you configure these parameters in my. cnf.
If you have the source code version of MySQL, you can find the my-huge.cnf under the support-files directory, open the my-large.cnf to see, choose the file that fits you
Preface:
# You can copy this file
#/Etc/my. cnf to set global options,
# Mysql-data-dir/my. cnf to set server-specific options (in this
# Installation this directory is) or
#~ /. My. cnf to set user-specific options.
#
# One can in this file use all long options that the program supports.
# If you want to know which options a program support, run the program
# With -- help option.