4

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?

dbdemon
  • 6,964
  • 4
  • 21
  • 40

2 Answers2

5

This depend if you set max_connections under the correct section inside my.cnf. what do you need to check(with examples)

  1. go to MySQL Directory cd /opt/mysql
  2. edit my.cnf using any text editor sudo vi my.cnf
  3. search for [mysqld]
  4. add the following lines directly under it max_connections=300
  5. save and quit
  6. restart the services.

Don't want a downtime?

  1. connect to MySQL using root user mysql -u root -p
  2. SET GLOBAL max_connections=300;
  3. 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