HiveBrain v1.2.0
Get Started
← Back to all entries
gotchasqlMinor

Difference between [mysql] and [mysqld] in MySQL configuration file

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
filemysqlddifferencemysqlbetweenandconfiguration

Problem

There are multiple sections in MySQL configuration file:

  • [mysql]



  • [mysqld]



  • [myisamchk]



  • [mysqld_safe]



  • [mysqlhotcopy]



  • [mysqldump]



  • [client]



I found that same variables with different values have been defined under these sections.

  • What are the specific purpose behind defining these sections?



  • Is it necessary to define all?



  • How MySQL interprets these variables?

Solution

MySQL calls these section "Groups". The [mysqld] group contains the variables apply to the MySQL Server (the mysqld process). The [mysql] group contains the variables for the client program (mysql).

The [client] option group is read by all client programs (but not by mysqld), so "mysql", "mysqldump" etc...

None of these groups are mandatory but usually we set at least the [mysqld] because it's where we configure the server.

About how MySQL interprets these variables, MySQL Documentation says:


If an option group name is the same as a program name, options in the
group apply specifically to that program.

Max

Context

StackExchange Database Administrators Q#64000, answer score: 7

Revisions (0)

No revisions yet.