There are many different programs in a MySQL installation. This section provides a brief overview of them. Later sections provide a more detailed description of each one, with the exception of MySQL Cluster programs. Each program's description indicates its invocation syntax and the options that it supports. Chapter 15, MySQL Cluster, describes programs specific to MySQL Cluster.
Most MySQL distributions include all of these programs, except for those programs that are platform-specific. (For example, the server startup scripts are not used on Windows.) The exception is that RPM distributions are more specialized. There is one RPM for the server, another for client programs, and so forth. If you appear to be missing one or more programs, see Chapter 2, Installing and Upgrading MySQL, for information on types of distributions and what they contain. It may be that you have a distribution that does not include all programs and you need to install an additional package.
Each MySQL program takes many different options. Most programs
--help option that you can use to get a
description of the program's different options. For example, try
You can override default option values for MySQL programs by specifying options on the command line or in an option file. See Section 4.2, “Using MySQL Programs”, for general information on invoking programs and specifying program options.
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 assist you in starting and stopping the server:
The SQL daemon (that is, the MySQL server). To use client programs, mysqld must be running, because clients gain access to databases by connecting to the server. See Section 4.3.1, “mysqld — The MySQL Server”.
A version of the server that includes additional features. See Section 5.2, “The mysqld-max Extended MySQL Server”.
A server startup script. mysqld_safe attempts to start mysqld-max if it exists, and mysqld otherwise. See Section 4.3.2, “mysqld_safe — MySQL Server Startup Script”.
A server startup script. This script is used on systems that use System V-style run directories containing scripts that start system services for particular run levels. It invokes mysqld_safe to start the MySQL server. See Section 4.3.3, “mysql.server — MySQL Server Startup Script”.
A server startup script that can start or stop multiple servers installed on the system. See Section 4.3.4, “mysqld_multi — Manage Multiple MySQL Servers”.
There are several programs that perform setup operations during MySQL installation or upgrading:
This program is used during the MySQL build/installation process. It compiles error message files from the error source files. See Section 4.4.1, “comp_err — Compile MySQL Error Message File”.
This program makes a binary release of a compiled MySQL. This
could be sent by FTP to
ftp.mysql.com for the convenience of other
This script is invoked by mysql_install_db to generate the SQL statements required to initialize the grant tables with default privileges. See Section 4.4.3, “mysql_create_system_tables — Generate Statements to Initialize MySQL System Tables”.
This program is used after a MySQL upgrade operation. It updates the grant tables with any changes that have been made in newer versions of MySQL. See Section 4.4.5, “mysql_fix_privilege_tables — Upgrade MySQL System Tables”.
This script creates the MySQL database and initializes the grant tables with default privileges. It is usually executed only once, when first installing MySQL on a system. See Section 4.4.6, “mysql_install_db — Initialize MySQL Data Directory”, Section 2.10.2, “Unix Postinstallation Procedures”, and Section 4.4.6, “mysql_install_db — Initialize MySQL Data Directory”.
This program enables you to improve the security of your MySQL installation. SQL. See Section 4.4.7, “mysql_secure_installation — Improve MySQL Installation Security”.
This program loads the time zone tables in the
mysql database using the contents of the
host system zoneinfo database (the set
of files describing time zones). SQL. See
Section 4.4.8, “mysql_tzinfo_to_sql — Load the Time Zone Tables”.
This program is used on Unix or Unix-like systems to create a MySQL source distribution that can be compiled on Windows. See Section 126.96.36.199, “Creating a Windows Source Package from the Latest Development Source”, and Section 4.4.2, “make_win_src_distribution — Create Source Distribution for Windows”.
MySQL client programs:
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
A client that performs administrative operations, such as creating or dropping databases, reloading the grant tables, flushing tables to disk, and reopening log files. mysqladmin can also be used to retrieve version, process, and status information from the server. See Section 4.5.2, “mysqladmin — Client for Administering a MySQL Server”.
A table-maintenance client that checks, repairs, analyzes, and optimizes tables. See Section 4.5.3, “mysqlcheck — A Table Maintenance Program”.
A client that dumps a MySQL database into a file as SQL, text, or XML. See Section 4.5.4, “mysqldump — A Database Backup Program”.
A client that imports text files into their respective tables
INFILE. See Section 4.5.5, “mysqlimport — A Data Import Program”.
A client that displays information about databases, tables, columns, and indexes. See Section 4.5.6, “mysqlshow — Display Database, Table, and Column Information”.
MySQL administrative and utility programs:
A utility that displays information about full-text indexes in
MyISAM tables. See
Section 4.6.1, “myisam_ftdump — Display Full-Text Index information”.
A utility to describe, check, optimize, and repair
MyISAM tables. isamchk
is a similar program for
ISAM tables. See
Section 4.6.2, “myisamchk — MyISAM Table-Maintenance Utility”.
Utilities that process the contents of a
ISAM log file.
See Section 4.6.3, “myisamlog — Display MyISAM Log File Contents”.
Utilities that compress
ISAM tables to produce smaller read-only
tables. See Section 4.6.4, “myisampack — Generate Compressed, Read-Only MyISAM Tables”.
A script that checks the access privileges for a host name, user name, and database combination. See Section 4.6.5, “mysqlaccess — Client for Checking Access Privileges”.
A utility for reading statements from a binary log. The log of executed statements contained in the binary log files can be used to help recover from a crash. See Section 4.6.6, “mysqlbinlog — Utility for Processing Binary Log Files”.
A utility to read and summarize the contents of a slow query log. See Section 4.6.7, “mysqldumpslow — Summarize Slow Query Log Files”.
A utility that quickly makes backups of
while the server is running. See
Section 4.6.8, “mysqlhotcopy — A Database Backup Program”.
A utility that converts tables in a database to use a given storage engine. See Section 4.6.11, “mysql_convert_table_format — Convert Tables to Use a Given Storage Engine”.
A utility that analyzes queries in the MySQL query log using
Section 4.6.12, “mysql_explain_log — Use EXPLAIN on Statements in Query Log”.
A utility that reads files containing SQL statements (such as update logs) and extracts statements that match a given regular expression. See Section 4.6.13, “mysql_find_rows — Extract SQL Statements from Files”.
A utility that converts the extensions for
files to lowercase. This can be useful after transferring the
files from a system with case-insensitive file names to a
system with case-sensitive file names. See
Section 4.6.14, “mysql_fix_extensions — Normalize Table File Name Extensions”.
A utility for interactively setting permissions in the MySQL grant tables. See Section 4.6.15, “mysql_setpermission — Interactively Set Permissions in Grant Tables”.
A utility that generates database metadata. Section 4.6.16, “mysql_tableinfo — Generate Database Metadata”.
A utility that kills the process with a given process ID. See Section 4.6.17, “mysql_waitpid — Kill Process and Wait for Its Termination”.
A utility that kills processes that match a pattern. See Section 4.6.18, “mysql_zap — Kill Processes That Match a Pattern”.
MySQL program-development utilities:
A shell script that converts
to MySQL. It doesn't handle every case, but it gives a good
start when converting. See Section 4.7.1, “msql2mysql — Convert mSQL Programs for Use with MySQL”.
A shell script that produces the option values needed when compiling MySQL programs. See Section 4.7.2, “mysql_config — Display Options for Compiling Clients”.
A utility that shows which options are present in option groups of option files. See Section 4.7.3, “my_print_defaults — Display Options from Option Files”.
A utility program that resolves a numeric stack trace dump to symbols. See Section 4.7.4, “resolve_stack_dump — Resolve Numeric Stack Trace Dump to Symbols”.
A utility that displays the meaning of system or MySQL error codes. See Section 4.8.1, “perror — Explain Error Codes”.
A utility program that performs string replacement in the input text. See Section 4.8.2, “replace — A String-Replacement Utility”.
A utility program that resolves a host name to an IP address or vice versa. See Section 4.8.3, “resolveip — Resolve Host name to IP Address or Vice Versa”.
Oracle Corporation also provides several GUI tools for administering and otherwise working with MySQL Server:
MySQL Workbench: This is the latest graphical tool for working with MySQL databases.
MySQL Administrator: This tool is used for administering MySQL servers, databases, tables, and user accounts.
MySQL Query Browser: This graphical tool is used for creating, executing, and optimizing queries on MySQL databases.
MySQL Migration Toolkit: This tool helps you migrate schemas and data from other relational database management systems for use with MySQL.
MySQL client programs that communicate with the server using the MySQL client/server library use the following environment variables.
|The default Unix socket file; used for connections to
|The default port number; used for TCP/IP connections|
|The default password|
|Debug trace options when debugging|
|The directory where temporary tables and files are created|
For a full list of environment variables used by MySQL programs, see Section 2.13, “Environment Variables”.
MYSQL_PWD is insecure. See
Section 188.8.131.52, “End-User Guidelines for Password Security”.