Chapter 8. Client and Utility Programs

Table of Contents

8.1. Overview of Client and Utility Programs
8.2. myisam_ftdump — Display Full-Text Index information
8.3. myisamchk — MyISAM Table-Maintenance Utility
8.3.1. myisamchk General Options
8.3.2. myisamchk Check Options
8.3.3. myisamchk Repair Options
8.3.4. Other myisamchk Options
8.3.5. myisamchk Memory Usage
8.4. myisamlog — Display MyISAM Log File Contents
8.5. myisampack — Generate Compressed, Read-Only MyISAM Tables
8.6. mysql — The MySQL Command-Line Tool
8.6.1. mysql Options
8.6.2. mysql Commands
8.6.3. mysql Server-Side Help
8.6.4. Executing SQL Statements from a Text File
8.6.5. mysql Tips
8.7. mysql_explain_log — Use EXPLAIN on Statements in Query Log
8.8. mysqlaccess — Client for Checking Access Privileges
8.9. mysqladmin — Client for Administering a MySQL Server
8.10. mysqlbinlog — Utility for Processing Binary Log Files
8.11. mysqlcheck — A Table Maintenance and Repair Program
8.12. mysqldump — A Database Backup Program
8.13. mysqlhotcopy — A Database Backup Program
8.14. mysqlimport — A Data Import Program
8.15. mysqlshow — Display Database, Table, and Column Information
8.16. mysql_zap — Kill Processes That Match a Pattern
8.17. perror — Explain Error Codes
8.18. replace — A String-Replacement Utility

There are many different MySQL client programs that connect to the server to access databases or perform administrative tasks. Other utilities are available as well. These do not establish a client connection with the server but perform MySQL-related operations.

This chapter provides a brief overview of these programs and then a more detailed description of each one. Each program's description indicates its invocation syntax and the options that it understands. See Chapter 4, Using MySQL Programs, for general information on invoking programs and specifying program options.

8.1. Overview of Client and Utility Programs

The following list briefly describes the MySQL client programs and utilities:

MySQL AB also provides a number of GUI tools for administering and otherwise working with MySQL servers. For basic information about these, see Chapter 4, Using MySQL Programs.

Each MySQL program takes many different options. Most programs provide a --help option that you can use to get a full description of the program's different options. For example, try mysql --help.

MySQL client programs that communicate with the server using the MySQL client/server library use the following environment variables:

MYSQL_UNIX_PORTThe default Unix socket file; used for connections to localhost
MYSQL_TCP_PORTThe default port number; used for TCP/IP connections
MYSQL_PWDThe default password
MYSQL_DEBUGDebug trace options when debugging
TMPDIRThe directory where temporary tables and files are created

Use of MYSQL_PWD is insecure. See Section 5.9.6, “Keeping Your Password Secure”.

You can override the default option values or values specified in environment variables for all standard programs by specifying options in an option file or on the command line. See Section 4.3, “Specifying Program Options”.