Using config file
The default config file is /etc/my.cnf (on Red Hat and CentOS systems) and /etc/mysql/my.cnf (Debian systems).
The config file has sections specified by section_name. All the parameters related to a section can be put under them, for example:
[mysqld] <---section name
<parameter_name> = <value> <---parameter values
[client]
<parameter_name> = <value>
[mysqldump]
<parameter_name> = <value>
[mysqld_safe]
<parameter_name> = <value>
[server]
<parameter_name> = <value>
[mysql]: Section is read by themysqlcommand-line client[client]: Section is read by all connecting clients (includingmysql cli)[mysqld]: Section is read by themysqlserver[mysqldump]: The section is read by the backup utility calledmysqldump[mysqld_safe]: Read by themysqld_safeprocess (MySQL Server Startup Script)
Apart from that the mysqld_safe process reads all options from the [mysqld] and [server] sections in option files. For example, mysqld_safe process reads the pid-file option from mysqld section.