1. There are many configuration files for mysql. There name looks like my-huge.cnf, my-medium.cnf.... Select the best one for our system and copy it as /etc/my.cnf.
2. open /etc/my.cnf(gedit, or vi). Goto the "mysqld" section, and add a new line:
skip-name-resolve #Do not resolve hostnames.
3. restart mysql.