Configuring MySQL server

MySQL has three different kinds of configuration, both for the server process at server startup and for the client processes when a user executes them.

In order of preference, these configuration options include:
  • Command-line options
  • Configuration file options
  • Environment variable options
MySQL specifies options according to the different groups, usually the names of the server tools. The options arranged in group segments. The group name placed within brackets and options applied to it follow.
It can be more clear when you will see the default /etc/my.cnf file.
[mysqld]
user=mysql
datadir=/var/lib/mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
tmpdir=/tmp
language=/usr/share/mysql/English

View the different options currently set for both server and client

Run mysqld directly with the –help option.

  • /usr/libexec/mysqld –help

changing the configuration of MySQL

  • basedir=directory
Specifies the root directory of your MySQL install.
batch
Executes in batch mode, meaning no command-line prompts or other information is sent to stdout. It is the default mode when used with a pipe.
  • character-sets-dir=directory
Specifies where your character set files stored.
compress
Tells the client and server to use compression in the network protocol.
  • datadir=directory
Specifies the location of MySQL's data files.
  • debug=filename
Specifies a file to send debug information.
force
Indicates that you want processing to continue for client utilities even when an error encountered.
  • host=hostname
Identifies the host to which a client should connect by default.
  • language=language
Specifies the language to use for localization.
  • log=filename
Specifies the file to which connections and queries logged.
  • log-isam=filename
Specifies the file to which isam changes logged.
  • password=password
Specifies a default password for clients to use to connect.
  • port=port_#
Specifies the port number to which the server should listen and to which clients should connect.
silent
Silently exit if a connection failure occurs.
  • skip-new-routines
Tells the MySQL server to avoid new, potential buggy routines.
  • skip-grant-tables
Tells the server to ignore all grant tables, effectively giving all users full access to the database server.
  • skip-locking
Potentially provides better system performance by avoiding system locking. It should not used in conjunction with isamchk or myisamchk.
  • sleep=seconds
Sleep between commands.
  • socket=name
Socket file to use for local connections.
  • user=username
Specifies the user name to use for client connections.
  • variable-name =value
Sets the specified variable name to a particular value.
  • verbose
Tells MySQL to talk more about what is happening.
wait
Tells the client to wait after a connection failure and then retry the connection.
MySQL supports multiple configuration files. As a general rule, it checks files in the following order of preference:
  • User configuration file (Linux only).
  • Configuration file specified through the –defaults-extra-file=filename option.
  • A configuration file in the MySQL data directory.
  • The system configuration file.
  • In all cases except the command-line and user configuration options, the name of the configuration file on Unix is my.cnf and on Windows is my.ini.
  • A Unix user can override system configuration information by building their configuration file in ~/.my.cnf.
  • The system configuration file on a Linux system is /etc/my.cnf.
Windows, on the other hand, has two system configuration locations, in order of preference:

C:my.cnf
C:WINNTSystem32my.cnf

You can alternately specify a file on the command line using the –defaults-file=filename option.
This option causes all the possibilities defined in other files to be ignored, even if they not overridden in the file you specify.

Companies

Price

Server Location

Price

Visit Now

adroitssd
Cloud SSD Hosting
$1.43 /mo. WILMINGTON, DE, US Price @ $1.43 /mo. Visit Now
247-host $2.99 /mo. LASALLE, CA Price @ $2.99 /mo. Visit Now
ehost.com $2.75/mo. Burlington, MA, US Price : $2.75/mo. Visit Now
siteground
Lifetime Free Domain
$3.95/mo. Panama, PA Start @ $3.95/mo. Visit Now
webhostingpad $1.99/mo. Arlington Heights, IL, US Start @ $1.99/mo. Visit Now
webhostingbuzz $4.95/mo AUBURN, MA, US Start @ $4.95/mo Visit Now
ipage
Cheapest Webhosting
$3.25/mo. Burlington, MA, US Start @ $3.25/mo. Visit Now
ixwebhosting $3.95/mo Columbus, OH, US Start @ $3.95/mo Visit Now
sitevalley $4.95/mo NASHUA, NH, US Start @ $4.95/mo Visit Now
liquidweb.com
Managed WordPress Hosting
$89.00/mo. Lansing, MI, US Price : $19.00/mo. Visit Now

Published by ananovareviews

I'm Communication Director with SCPL. Our goal is to deliver the most accurate information possible based on the needs of the majority of website owners and developers, and Ananova reports deliver the most reliable indicators of web host performance. - http://www.ananova.com

%d bloggers like this: