11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

www.it-ebooks.infoCHAPTER 26 • INSTALLING AND CONFIGURING MYSQLtweaking the startup parameters—as well as the behaviors—of many <strong>MySQL</strong> clients, includingmysqladmin, myisamchk, myisampack, mysql, mysqlcheck, mysqld, mysqldump, mysqld_safe, mysql.server,mysqlhotcopy, mysqlimport, and mysqlshow. You can maintain these tweaks within <strong>MySQL</strong>’sconfiguration file, my.cnf.At startup, <strong>MySQL</strong> looks in several directories for the my.cnf file, with each directory determiningthe scope of the parameters declared within. The location and relative scope of each directory ishighlighted here:• /etc/my.cnf (C:\my.cnf or windows-sys-directory\my.ini on Windows): Globalconfiguration file. All <strong>MySQL</strong> server daemons located on the server refer first tothis file. Note the extension of .ini if you choose to place the configuration file inthe Windows system directory.• DATADIR/my.cnf: Server-specific configuration. This file is placed in the directoryreferenced by the server installation. A somewhat odd, yet crucial characteristic ofthis configuration file is that it references only the data directory specified atconfiguration time, even if a new data directory is specified at run time. Note that<strong>MySQL</strong>’s Windows distribution does not support this feature.• --defaults-extra-file=name: The file specified by the supplied file name,complete with absolute path.• ~/.my.cnf: User-specific configuration. This file is expected to be located in theuser’s home directory. Note that <strong>MySQL</strong>’s Windows distribution does not supportthis feature.You should understand that <strong>MySQL</strong> attempts to read from each of these locations at startup. Ifmultiple configuration files exist, parameters read in later take precedence over earlier parameters.Although you could create your own configuration file, you should base your file upon one of fivepreconfigured my.cnf files, all of which are supplied with the <strong>MySQL</strong> distribution. These templates arehoused in INSTALL-DIR/support-files (on Windows these files are found in the installation directory).The purpose of each is defined in Table 26-1.Table 26-1. <strong>MySQL</strong> Configuration TemplatesNamemy-huge.cnfmy-innodb-heavy-4G.cnfmy-large.cnfmy-medium.cnfDescriptionIntended for high-end production servers, containing 1 to 2GB RAM,tasked with primarily running <strong>MySQL</strong>Intended for InnoDB-only installations for up to 4GB RAM involvinglarge queries and low trafficIntended for medium-sized production servers, containing around512MB RAM, tasked with primarily running <strong>MySQL</strong>Intended for low-end production servers containing little memory(less than 128MB)501

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!