If you want to change some of the global configuration setting of MySQL There are two ways.
1. By Changing variable using
SET GLOBAL option on running MySQL instance,this does not require server restart we can change variables like Ex : I need to set my key buffer to 128 MB
SET GLOBAL key_buffer_size = 128*1024*1024;
But using this technique we can not change or configure all variables and once we restart MySQL these GLOBAL settings are lost.
2. By Changing variables in config file (my.cnf)
This requires a server restart but changes are permanent.