Percona MySQL example my.cnf file for 4GB available RAM for MySQL. See current usage by running :
/usr/sbin/mysqld --verbose --help
Then load this file from :
/etc/mysql/my.cnf
Then reload MySQL.
IMPORTANT : "4GB available RAM for MySQL" means server minimum has 12 GB physical RAM for LAMP server and 8 GB physical RAM for dedicated physical server