Home arrow MySQL arrow Page 5 - Back to Basics

File Format - MySQL

This chapter from High Performance MySQL by Jeremy Zawodny and Derek J. Balling. (O'Reilly Media, ISBN: 0-596-00306-4, April 2004) talks about binary distributions, the sections in a configuration file, and some SHOW commands that provide a window into whatís going on inside MySQL. This book is for the MySQL administrator who has the basics down but realizes the need to go further.

  1. Back to Basics
  2. Binary Versus Compiled From Source Installations
  3. MySQL.com Binary Versus Distribution Binary
  4. Configuration Files
  5. File Format
  6. Sample Files
  7. Reconfiguration
  8. The SHOW Commands
By: O'Reilly Media
Rating: starstarstarstarstar / 19
June 08, 2004

print this article



The configuration file format consists of one or more sections, each of which may contain one or more lines. Sections begin with a name in square brackets, such as [ mysqld ] ; this identifies the program to which the options should be applied. Each line contains a comment, a key/value pair, a set-variable directive, or a Boolean directive. Blank lines are ignored.

Two special section names can occur in each configuration file: [server] and [client] . Items listed in the [server] block apply to the MySQL server process. Those in the [client] section apply to all client programs that use the MySQL C cli ent library, including mysql , mysqlhotcopy , and mysqldump .

Comments begin with # or ; and continue to the end of the line:

# this is a comment
; so is this

There is no multiline comment format. You canít place a comment at the end of an otherwise non-empty line:

key_buffer=128M # a comment can't go here

The key/value pairs are settings such as:

> user = mysql
port = 3306

The set-variable statements look like key/value pairs in which the value is a key/ value pair itself:  

> set-variable = key_buffer=384M

set-variable = tmp_table_size=32M

Spaces arenít important in set-variable lines. You can also write the two previous lines as follows:

set-variable = key_buffer = 384 M
set-variable=tmp_table_size=32 M

Either way, MySQL will understand you. However, consider using some space to enhance readability.

As of Version 4.1, the set-variable= portion of the variable definition is no longer needed and is deprecated. In current versions:

set-variable = key_buffer=384M



are both interpreted in an identical manner by the server at startup time. If you are running a version that supports leaving out the set-variable clause, it probably is best to do so because it wonít be supported forever. Weíve chosen to use the older format here because itís what youíre likely to have already, and the sample configura tion files in the standard MySQL distribution continue to use it.

The few boolean directives are just stated plainly:


Individual lines in the configuration file are limited to 2 KB in length. While itís rare that youíll ever need to use a line that long, it can occasionally be a problem.

Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

Visit the O'Reilly Network http://www.oreillynet.com for more online content.

>>> More MySQL Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates


Dev Shed Tutorial Topics: