There are many different programs in a MySQL installation. MySQL安装中有许多不同的程序。This section provides a brief overview of them. 本节简要概述了它们。Later sections provide a more detailed description of each one, with the exception of NDB Cluster programs. 除NDB群集程序外,后面的章节将对每种程序进行更详细的描述。Each program's description indicates its invocation syntax and the options that it supports. 每个程序的描述都指示其调用语法及其支持的选项。Section 23.4, “NDB Cluster Programs”, describes programs specific to NDB Cluster.第23.4节,“NDB集群计划”描述了特定于NDB集群的计划。
Most MySQL distributions include all of these programs, except for those programs that are platform-specific. 大多数MySQL发行版包括所有这些程序,但平台特定的程序除外。(For example, the server startup scripts are not used on Windows.) (例如,Windows上不使用服务器启动脚本。)The exception is that RPM distributions are more specialized. 例外情况是RPM发行版更加专业化。There is one RPM for the server, another for client programs, and so forth. 一个RPM用于服务器,另一个RPM用于客户端程序,等等。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. 如果您似乎缺少一个或多个程序,请参阅第2章,“安装和升级MySQL”,以了解有关发行版类型及其包含内容的信息。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 provide a 每个MySQL程序都有许多不同的选项。大多数程序都提供了--help
option that you can use to get a description of the program's different options. --help
选项,您可以使用它来获取程序不同选项的描述。For example, try mysql --help.例如,尝试mysql --help
。
You can override default option values for MySQL programs by specifying options on the command line or in an option file. 通过在命令行或选项文件中指定选项,可以覆盖MySQL程序的默认选项值。See Section 4.2, “Using MySQL Programs”, for general information on invoking programs and specifying program options.有关调用程序和指定程序选项的一般信息,请参阅第4.2节,“使用MySQL程序”。
The MySQL server, mysqld, is the main program that does most of the work in a MySQL installation. MySQL服务器mysqld
是在MySQL安装中完成大部分工作的主程序。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). SQL守护进程(即MySQL服务器)。To use client programs, mysqld must be running, because clients gain access to databases by connecting to the server. 要使用客户端程序,mysqld必须运行,因为客户端通过连接到服务器来访问数据库。See Section 4.3.1, “mysqld — The MySQL Server”.请参阅第4.3.1节,“mysqld - MySQL服务器”。
A server startup script. 服务器启动脚本。mysqld_safe attempts to start mysqld. mysqld_safe尝试启动mysqld。See Section 4.3.2, “mysqld_safe — MySQL Server Startup Script”.请参阅第4.3.2节,“mysqld_safe - MySQL服务器启动脚本”。
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. 此脚本用于使用System V样式运行目录的系统,其中包含为特定运行级别启动系统服务的脚本。It invokes mysqld_safe to start the MySQL server. 它调用mysqld_safe来启动MySQL服务器。See Section 4.3.3, “mysql.server — MySQL Server Startup Script”.请参阅第4.3.3节,“mysql.server - mysql服务器启动脚本”。
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”.请参阅第4.3.4节,“mysqld - 多管理多个MySQL服务器”。
Several programs perform setup operations during MySQL installation or upgrading:几个程序在MySQL安装或升级期间执行安装操作:
This program is used during the MySQL build/installation process. 此程序在MySQL构建/安装过程中使用。It compiles error message files from the error source files. 它从错误源文件编译错误消息文件。See Section 4.4.1, “comp_err — Compile MySQL Error Message File”.请参阅第4.4.1节,“comp_err - 编译MySQL错误消息文件”。
This program enables you to improve the security of your MySQL installation. 此程序使您能够提高MySQL安装的安全性。See Section 4.4.2, “mysql_secure_installation — Improve MySQL Installation Security”.请参阅第4.4.2节,“mysql_secure_installation - 提高mysql安装安全性”。
This program creates the SSL certificate and key files and RSA key-pair files required to support secure connections, if those files are missing. 此程序创建支持安全连接所需的SSL证书和密钥文件以及RSA密钥对文件(如果缺少这些文件)。Files created by mysql_ssl_rsa_setup can be used for secure connections using SSL or RSA. mysql_ssl_rsa_setup创建的文件可用于使用ssl或rsa的安全连接。See Section 4.4.3, “mysql_ssl_rsa_setup — Create SSL/RSA Files”.请参阅第4.4.3节,“mysql_ssl_rsa_setup - 创建ssl/rsa文件”。
This program loads the time zone tables in the 该程序使用主机系统zoneinfo数据库(描述时区的一组文件)的内容加载mysql
database using the contents of the host system zoneinfo database (the set of files describing time zones). mysql
数据库中的时区表。See Section 4.4.4, “mysql_tzinfo_to_sql — Load the Time Zone Tables”.请参阅第4.4.4节,“mysql_tzinfo_to_sql - 加载时区表”。
Prior to MySQL 8.0.16, this program is used after a MySQL upgrade operation. 在MySQL 8.0.16之前,此程序是在MySQL升级操作后使用的。It updates the grant tables with any changes that have been made in newer versions of MySQL, and checks tables for incompatibilities and repairs them if necessary. 它使用在较新版本的MySQL中所做的任何更改来更新grant表,并检查表的不兼容性,必要时进行修复。See Section 4.4.5, “mysql_upgrade — Check and Upgrade MySQL Tables”.请参阅第4.4.5节,“mysql_upgrade - 检查并升级mysql表”。
As of MySQL 8.0.16, the MySQL server performs the upgrade tasks previously handled by mysql_upgrade (for details, see Section 2.11.3, “What the MySQL Upgrade Process Upgrades”).从MySQL 8.0.16开始,MySQL服务器执行之前由mysql_upgrade处理的升级任务(有关详细信息,请参阅第2.11.3节,“MySQL升级过程升级的内容”)。
MySQL client programs that connect to the MySQL server:连接到MySQL服务器的MySQL客户端程序:
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. 用于以交互方式输入SQL语句或以批处理方式从文件执行SQL语句的命令行工具。See Section 4.5.1, “mysql — The MySQL Command-Line Client”.请参阅第4.5.1节,“mysql-MySQL命令行客户端”。
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. mysqladmin还可用于从服务器检索版本、进程和状态信息。See Section 4.5.2, “mysqladmin — A MySQL Server Administration Program”.请参阅第4.5.2节,“mysqladmin-一个MySQL服务器管理程序”。
A table-maintenance client that checks, repairs, analyzes, and optimizes tables. 检查、修复、分析和优化表的表维护客户端。See Section 4.5.3, “mysqlcheck — A Table Maintenance Program”.请参阅第4.5.3节,“mysqlcheck-表格维护程序”。
A client that dumps a MySQL database into a file as SQL, text, or XML. 将MySQL数据库作为SQL、文本或XML转储到文件中的客户端。See Section 4.5.4, “mysqldump — A Database Backup Program”.请参阅第4.5.4节,“mysqldump-数据库备份程序”。
A client that imports text files into their respective tables using 使用LOAD DATA
. LOAD DATA
将文本文件导入其各自表的客户端。See Section 4.5.5, “mysqlimport — A Data Import Program”.请参阅第4.5.5节,“mysqlimport-数据导入程序”。
A client that dumps a MySQL database into a file as SQL. 将MySQL数据库作为SQL转储到文件中的客户端。See Section 4.5.6, “mysqlpump — A Database Backup Program”.请参阅第4.5.6节,“mysqlpump-数据库备份程序”。
mysqlsh
MySQL Shell is an advanced client and code editor for MySQL Server. MySQL Shell是MySQL服务器的高级客户端和代码编辑器。See MySQL Shell 8.0. 请参阅MySQL Shell 8.0。In addition to the provided SQL functionality, similar to mysql, MySQL Shell provides scripting capabilities for JavaScript and Python and includes APIs for working with MySQL. 除了提供的SQL功能(类似于mysql),mysql Shell还提供JavaScript和Python脚本功能,并包括用于使用mysql的API。X DevAPI enables you to work with both relational and document data, see Chapter 20, Using MySQL as a Document Store. X DevAPI使您能够处理关系数据和文档数据,请参阅第20章,“使用MySQL作为文档存储”。AdminAPI enables you to work with InnoDB Cluster, see Using MySQL AdminAPI.AdminAPI使您能够使用InnoDB
集群,请参阅使用MySQL AdminAPI。
A client that displays information about databases, tables, columns, and indexes. 显示有关数据库、表、列和索引的信息的客户端。See Section 4.5.7, “mysqlshow — Display Database, Table, and Column Information”.请参阅第4.5.7节,“mysqlshow-显示数据库、表和列信息”。
A client that is designed to emulate client load for a MySQL server and report the timing of each stage. 设计用于模拟MySQL服务器的客户端负载并报告每个阶段的时间的客户端。It works as if multiple clients are accessing the server. 它的工作原理就像多个客户端正在访问服务器一样。See Section 4.5.8, “mysqlslap — A Load Emulation Client”.请参阅第4.5.8节,“mysqlslap-负载模拟客户端”。
MySQL administrative and utility programs:MySQL管理和实用程序:
An offline 脱机InnoDB
offline file checksum utility. InnoDB
脱机文件校验和实用程序。See Section 4.6.2, “innochecksum — Offline InnoDB File Checksum Utility”.请参阅第4.6.2节,“innochecksum-脱机InnoDB
文件校验和实用程序”。
A utility that displays information about full-text indexes in 显示MyISAM
tables. MyISAM
表中全文索引信息的实用程序。See Section 4.6.3, “myisam_ftdump — Display Full-Text Index information”.请参阅第4.6.3节,“Myisamftdump-显示全文索引信息”。
A utility to describe, check, optimize, and repair 用于描述、检查、优化和修复MyISAM
tables. MyISAM
表的实用程序。See Section 4.6.4, “myisamchk — MyISAM Table-Maintenance Utility”.请参阅第4.6.4节,“myisamchk-MyISAM
表格维护实用程序”。
A utility that processes the contents of a 处理MyISAM
log file. MyISAM
日志文件内容的实用程序。See Section 4.6.5, “myisamlog — Display MyISAM Log File Contents”.请参阅第4.6.5节,“MyISAM
日志-显示MyISAM
日志文件内容”。
A utility that compresses 压缩MyISAM
tables to produce smaller read-only tables. MyISAM
表以生成较小的只读表的实用程序。See Section 4.6.6, “myisampack — Generate Compressed, Read-Only MyISAM Tables”.请参阅第4.6.6节,“myisampack-生成压缩的只读MyISAM
表”。
A utility that enables you to store authentication credentials in a secure, encrypted login path file named 一种实用工具,使您能够将身份验证凭据存储在名为.mylogin.cnf
. .mylogin.cnf
的安全加密登录路径文件中。See Section 4.6.7, “mysql_config_editor — MySQL Configuration Utility”.请参阅第4.6.7节,“mysql配置编辑器-mysql配置实用程序”。
A utility for migrating keys between one keyring component and another. 用于在一个密钥环组件和另一个密钥环组件之间迁移密钥的实用程序。See Section 4.6.8, “mysql_migrate_keyring — Keyring Key Migration Utility”.请参阅第4.6.8节,“mysql_migrate_keyring-keyring密钥迁移实用程序”。
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.9, “mysqlbinlog — Utility for Processing Binary Log Files”.请参阅第4.6.9节,“mysqlbinlog-处理二进制日志文件的实用程序”。
A utility to read and summarize the contents of a slow query log. 用于读取和汇总慢速查询日志内容的实用程序。See Section 4.6.10, “mysqldumpslow — Summarize Slow Query Log Files”.请参阅第4.6.10节,“mysqldumpslow-汇总慢速查询日志文件”。
MySQL program-development utilities:MySQL程序——开发实用程序:
A shell script that produces the option values needed when compiling MySQL programs. 一个shell脚本,用于生成编译MySQL程序时所需的选项值。See Section 4.7.1, “mysql_config — Display Options for Compiling Clients”.请参阅第4.7.1节,“mysql_config-编译客户端的显示选项”。
A utility that shows which options are present in option groups of option files. 显示选项文件的选项组中存在哪些选项的实用程序。See Section 4.7.2, “my_print_defaults — Display Options from Option Files”.请参阅第4.7.2节,“我的打印默认值-选项文件中的显示选项”。
Miscellaneous utilities:杂项公用设施:
A utility that decompresses mysqlpump output that was created using LZ4 compression. 对使用LZ4压缩创建的mysqlpump输出进行解压缩的实用程序。See Section 4.8.1, “lz4_decompress — Decompress mysqlpump LZ4-Compressed Output”.请参阅第4.8.1节,“lz4_减压-减压泵lz4压缩输出”。
A utility that displays the meaning of system or MySQL error codes. 显示系统或MySQL错误代码含义的实用程序。See Section 4.8.2, “perror — Display MySQL Error Message Information”.请参阅第4.8.2节,“perror-显示MySQL错误消息信息”。
A utility that decompresses mysqlpump output that was created using ZLIB compression. 对使用ZLIB压缩创建的mysqlpump输出进行解压缩的实用程序。See Section 4.8.3, “zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output”.请参阅第4.8.3节,“zlib_解压-解压泵zlib压缩输出”。
Oracle Corporation also provides the MySQL Workbench GUI tool, which is used to administer MySQL servers and databases, to create, execute, and evaluate queries, and to migrate schemas and data from other relational database management systems for use with MySQL.甲骨文集团还提供了MySQL Workbench GUI工具,用于管理MySQL服务器和数据库,创建、执行和评估查询,以及从其他关系数据库管理系统迁移模式和数据以用于MySQL。
MySQL client programs that communicate with the server using the MySQL client/server library use the following environment variables.使用MySQL客户机/服务器库与服务器通信的MySQL客户机程序使用以下环境变量。
MYSQL_UNIX_PORT | localhost localhost< /ins> |
MYSQL_TCP_PORT | |
MYSQL_DEBUG | |
TMPDIR |
For a full list of environment variables used by MySQL programs, see Section 4.9, “Environment Variables”.有关MySQL程序使用的环境变量的完整列表,请参阅第4.9节,“环境变量”。