'MYSQL - max_connections

I have the following mysql installed mysql Ver 14.14 Distrib 5.7.37, for Linux (x86_64) using EditLine wrapper. I need to increase the max_connection parameter from the default 150 permanently. I had a look at all the answers posted on stackoverflow and can't seem to find a solution that works. The only place I was able to find a glimpse of this is parameter is in /etc/mysql/mysql.conf.d/mysqld.cnf but in there max_connections parameter seem to be commented out. I tried changing it removing the # and restarted the server, didn't work. the mysql.cnf file under /etc/mysql does not contain any parameters as well, just

# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source