Restart mysql service immediately after changing my.cnf.