DBA > Articles


By: Sams Publishing
To read more DBA articles, visit http://dba.fyicenter.com/article/

If you need to administer MySQL, this article gets you off to a good start. The first of a multi-part series, it is excerpted from chapter four of the book MySQL Administrator's Guide, written by Paul Dubois.

The MySQL Server and Server Startup Scripts
The MySQL server, mysqld, is the main program that does most of the work in a MySQL installation. The server is accompanied by several related scripts that perform setup operations when you install MySQL or that are helper programs to assist you in starting and stopping the server.

This section provides an overview of the server and related programs, and information about server startup scripts. Information about configuring the server itself is given in Section 4.2, "Configuring the MySQL Server."

4.1.1 Overview of the Server-Side Scripts and Utilities
All MySQL programs take many different options. However, every MySQL program provides a --help option that you can use to get a description of the program's options. For example, try mysqld --help.

You can override default options for all standard programs by specifying options on the command line or in an option file. See Section 3.3, "Specifying Program Options."

The following list briefly describes the MySQL server and server-related programs:
* mysqld
The SQL daemon (that is, the MySQL server). To use client programs, this program must be running, because clients gain access to databases by connecting to the server. See Section 4.2, "Configuring the MySQL Server."

* mysqld-max
A version of the server that includes additional features. See Section 4.1.2, "The mysqld-max Extended MySQL Server."
* mysqld_safe
A server startup script. mysqld_safe attempts to start mysqld-max if it exists, and mysqld otherwise. See Section 4.1.3, "The mysqld_safe Server Startup Script."
* mysql.server
A server startup script. This script is used on systems that use run directories containing scripts that start system services for particular run levels. It invokes mysqld_safe to start the MySQL server. See Section 4.1.4, "The mysql.server Server Startup Script."
* mysqld_multi
A server startup script that can start or stop multiple servers installed on the system. See Section 4.1.5, "The mysqld_multi Program for Managing Multiple MySQL Servers."
* mysql_install_db
This script creates the MySQL grant tables with default privileges. It is usually executed only once, when first installing MySQL on a system.
* mysql_fix_privilege_tables
This script is used after an upgrade install operation, to update the grant tables with any changes that have been made in newer versions of MySQL.
There are several other programs that also are run on the server host:

* myisamchk
A utility to describe, check, optimize, and repair MyISAM tables. myisamchk is described in Section 4.6.2, "Table Maintenance and Crash Recovery."
* make_binary_distribution
This program makes a binary release of a compiled MySQL. This could be sent by FTP to /pub/mysql/upload on ftp.mysql.com for the convenience of other MySQL users.
* mysqlbug
The MySQL bug reporting script. It can be used to send a bug report to the MySQL mailing list. (You can also visit http://bugs.mysql.com/ to file a bug report online.)

A MySQL-Max server is a version of the mysqld MySQL server that has been built to include additional features.

The distribution to use depends on your platform:

* For Windows, MySQL binary distributions include both the standard server (mysqld.exe) and the MySQL-Max server (mysqld-max.exe), so you need not get a special distribution. Just use a regular Windows distribution, available at http://dev.mysql.com/downloads/mysql-4.0.html. See Section 2.2.1, "Installing MySQL on Windows."

* For Linux, if you install MySQL using RPM distributions, use the regular MySQL-server RPM first to install a standard server named mysqld. Then use the MySQL-Max RPM to install a server named mysqld-max. The MySQL-Max RPM presupposes that you have already installed the regular server RPM. See Section 2.2.2, "Installing MySQL on Linux," for more information on the Linux RPM packages.

* All other MySQL-Max distributions contain a single server that is named mysqld but that has the additional features included.
You can find the MySQL-Max binaries on the MySQL AB Web site at http://dev.mysql.com/downloads/mysql-max-4.0.html.
MySQL AB builds the MySQL-Max servers by using the following configure options:
* --with-server-suffix=-max
This option adds a -max suffix to the mysqld version string.
* --with-innodb
This option enables support for the InnoDB storage engine. MySQL-Max servers always include InnoDB support, but this option actually is needed only for MySQL 3.23. From MySQL 4 on, InnoDB is included by default in binary distributions, so you do not need a MySQL-Max server to obtain InnoDB support.

* --with-bdb
This option enables support for the Berkeley DB (BDB) storage engine.
This define enables symbolic link support for Windows.
MySQL-Max binary distributions are a convenience for those who wish to install precompiled programs. If you build MySQL using a source distribution, you can build your own Max-like server by enabling the same features at configuration time that the MySQL-Max binary distributions are built with.

MySQL-Max servers include the BerkeleyDB (BDB) storage engine whenever possible, but not all platforms support BDB. The following table shows which platforms allow MySQL-Max binaries to include BDB:

Full article...

Other Related Articles

... to read more DBA articles, visit http://dba.fyicenter.com/article/