Databases Reference
In-Depth Information
Now consider the case where MySQL has been installed to the directory /home/adam/
mysql-5.0.22 . You can imagine the directory /Users/adam/mysql-5.0.22 being used for
Mac OS X. For nonstandard installations, the mysqld_safe program should be called
from the MySQL installation directory, so we first change to that directory:
$ cd /home/adam/mysql-5.0.22
and then start the server by typing (all on one line):
$ bin/mysqld_safe \
--port=57777 \
--socket=/home/adam/mysql-5.0.22/logs/mysqld-new.sock.file \
--basedir=/home/adam/mysql-5.0.22 \
--datadir=/home/adam/mysql-5.0.22/data \
--log=/home/adam/mysql-5.0.22/logs/main.log \
--log-error=/home/adam/mysql-5.0.22/logs/error.log \
--pid-file=/home/adam/mysql-5.0.22/logs/zahra.pid
The corresponding options file entries would be:
[mysqld]
port= 57777
socket= /home/adam/mysql-5.0.22/logs/mysqld-new.sock.file
basedir= /home/adam/mysql-5.0.22
datadir= /home/adam/mysql-5.0.22/data
log= /home/adam/mysql-5.0.22/logs/main.log
log-error=/home/adam/mysql-5.0.22/logs/error.log
pid-file= /home/adam/mysql-5.0.22/logs/zahra.pid
Finally, let's look at an example for Windows, where we have MySQL installed in the
directory C:\mysql-5.0.22-win32 . We want to have the MySQL datafiles placed in
C:\mysql\data , we want the logfiles placed in C:\mysql\logs , and we want the server to
listen on port 13306. So we type (all on one line):
C:\> mysqld-net.exe \
--port=13306 \
--basedir=C:\mysql-5.0.22-win32 \
--datadir=C:\mysql\data \
--log-bin=C:\mysql\logs\mysql-binary.log
Note that the specified directories must exist, and the data directory must contain the
mysql database files (the privilege tables); otherwise, MySQL will complain and abort.
Server Variables
Variables configure server resources and can be used to optimize the server settings to
suit the hardware of the host computer, and to allocate resources for improved per-
formance. For example, the variable max_connections specifies the maximum number
of clients that can be connected to the server at any one time.
When choosing a value for a server variable, you need to think carefully about the
nature of your application and your clients. For example, when setting the
 
Search WWH ::




Custom Search