Every time I reboot Mariadb places me the max_connections in 151 and in the my.cnf I have it with 300. Why does this happen?
Asked
Active
Viewed 1.5k times
2 Answers
5
This depend if you set max_connections under the correct section inside my.cnf. what do you need to check(with examples)
- go to MySQL Directory
cd /opt/mysql - edit
my.cnfusing any text editorsudo vi my.cnf - search for
[mysqld] - add the following lines directly under it
max_connections=300 - save and quit
- restart the services.
Don't want a downtime?
- connect to MySQL using root user
mysql -u root -p SET GLOBAL max_connections=300;quit
Ahmad Abuhasna
- 2,718
- 4
- 25
- 36
0
What OS are you on?
If you are on Windows you can do this:
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --verbose --help | findstr /i ini
Part of the output on my system is:
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf C:\Program Files\MySQL\MySQL Server 8.0\my.ini C:\Program Files\MySQL\MySQL Server 8.0\my.cnf
Which are ALL the possible location this setting can be at 151, and not at 300.
Luuk
- 933
- 5
- 13