Databases Reference
In-Depth Information
Sometimes you might also need to set specific configuration options that can have a
significant performance impact in special cases. However, these should not be part of
a basic server configuration file. You should set them only when you find the specific
performance problems they address. That's why we don't suggest that you approach
configuration options by looking for bad things to improve. If something needs to be
improved, it should show up in query response times. It's best to start your search with
queries and their response times, not with configuration options. This could save you
a lot of time and prevent many problems.
Another good way to save time and trouble is to use the defaults unless you know you
shouldn't. There is safety in numbers, and a lot of people are running with default
settings. That makes them the most thoroughly tested settings. Unexpected bugs can
arise when you change things needlessly.
How MySQL's Configuration Works
We'll begin by explaining MySQL's configuration mechanisms, before covering what
you should configure in MySQL. MySQL is generally pretty forgiving about its config-
uration, but following these suggestions might save you a lot of work and time.
The first thing to know is where MySQL gets configuration information: from
command-line arguments and settings in its configuration file. On Unix-like systems,
the configuration file is typically located at /etc/my.cnf or /etc/mysql/my.cnf . If you use
your operating system's startup scripts, this is typically the only place you'll specify
configuration settings. If you start MySQL manually, which you might do when you're
running a test installation, you can also specify settings on the command line. The
server actually reads the contents of the configuration file, removes any comment lines
and newlines, and then processes it together with the command-line options.
A note on terminology: because many of MySQL's command-line op-
tions correspond to server variables, we sometimes use the terms op-
tion and variable interchangeably. Most variables have the same names
as their corresponding command-line options, but there are a few ex-
ceptions. For example, --memlock sets the locked_in_memory variable.
Any settings you decide to use permanently should go into the global configuration
file, instead of being specified at the command line. Otherwise, you risk accidentally
starting the server without them. It's also a good idea to keep all of your configuration
files in a single place so that you can inspect them easily.
Be sure you know where your server's configuration file is located! We've seen people
try unsuccessfully to configure a server with a file it doesn't read, such as /etc/my.cnf
on Debian servers, which look in /etc/mysql/my.cnf for their configuration. Sometimes
 
Search WWH ::




Custom Search