MySQL
  Home arrow MySQL arrow Page 5 - Back to Basics
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Back to Basics
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 19
    2004-06-08

    Table of Contents:
  • Back to Basics
  • Binary Versus Compiled From Source Installations
  • MySQL.com Binary Versus Distribution Binary
  • Configuration Files
  • File Format
  • Sample Files
  • Reconfiguration
  • The SHOW Commands
  • SHOW PROCESSLIST
  • SHOW STATUS

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Back to Basics - File Format


    (Page 5 of 10 )

    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

    and:

    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:

    skip-bdb

    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


     

       

    MYSQL ARTICLES

    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...
    - Creating the Blog Script for a PHP/MySQL Blo...

    BlackBerry VTS




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway