Check that MySQL is running after writing the config instead of before.