How do I set my.cnf in Mysql so that there are no limits to connections?

Solution 1:

There is no such thing as unlimited connections. You must consider system resources, memory usage per thread, as well as types of queries being executed.

If this setting is not properly configured, you risk MySQL running out of memory and restarting, which could result in data loss or corruption.

The support-files directory includes sample configurations, which could be used as starting points. Also, the link below has more a detailed description description with how to tune the setting.

There's also formulae that I like to put in spreadsheets for memory calculation per thread.

  • Tuning max connections
  • InnoDB Memory Usage