content_image/845495.jpg
•As an alternative to the preceding setup, some operating systems also use /etc/rc.local  or /etc/ init.d/boot.local  to start additional services on startup. To start up MySQL using this method, append a command like the one following to the appropriate startup file: 

/bin/sh -c ’cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &’ 

•For other systems, consult your operating system documentation to see how to install startup scripts. 

mysql.server  reads options from the [mysql.server]  and [mysqld]  sections of option files. For backward compatibility, it also reads [mysql_server]  sections, but to be current you should rename such sections to [mysql.server] . 

You can add options for mysql.server  in a global /etc/my.cnf  file. A typical my.cnf  file might look like this: 

[mysqld] datadir=/usr/local/mysql/var socket=/var/tmp/mysql.sock port=3306 user=mysql [mysql.server] basedir=/usr/local/mysql 

The mysql.server  script supports the options shown in the following table. If specified, they must  be placed in an option file, not on the command line. mysql.server  supports only start  and stop  as command-line arguments. 

<img src='content_image/845495.jpg'>

## • basedir= dir_name 

The path to the MySQL installation directory. 

## • datadir= dir_name 

The path to the MySQL data directory. 

## • pid-file= file_name 

The path name of the file in which the server should write its process ID. The server creates the file in the data directory unless an absolute path name is given to specify a different directory. 

If this option is not given, mysql.server  uses a default value of host_name .pid . The PID file value passed to mysqld_safe  overrides any value specified in the [mysqld_safe]  option file group. Because mysql.server  reads the [mysqld]  option file group but not the [mysqld_safe]  group, you can ensure that mysqld_safe  gets the same value when invoked from mysql.server  as when invoked manually by putting the same pid-file  setting in both the [mysqld_safe]  and [mysqld] groups. 

