Sometimes the line isn't there, if thats the case insert it under the [mysqld] section. Make a backup of the file just in case you mess it up, so that you quickly can start mysql again if it fails to start using the new file.
Add the following line in your my.cnf file under [mysqld]
set-variable = max_connections= xxxx
[xxxx = no of connections you like to set ]
AssistanZ - Beyond Boundaries... Cloudstack Consultancy / 24x7 Web Hosting Support / 24x7 Server Management / Infrastructure Management Services Web & Mobile Apps Development / Web Designing Services / Php, Grails, Java Development