Before posting a bug report about a problem, please try to verify that it is a bug and that it has not been reported already:在发布有关问题的错误报告之前,请尝试验证这是一个错误,并且尚未报告:
Start by searching the MySQL online manual at https://dev.mysql.com/doc/. 首先在https://dev.mysql.com/doc/上搜索MySQL在线手册。We try to keep the manual up to date by updating it frequently with solutions to newly found problems. 我们经常更新手册,以解决新发现的问题,从而使手册保持最新。In addition, the release notes accompanying the manual can be particularly useful since it is quite possible that a newer version contains a solution to your problem. The release notes are available at the location just given for the manual.此外,手册附带的发行说明可能特别有用,因为更新的版本很可能包含您的问题的解决方案。发布说明可在刚刚为手册提供的位置找到。
If you get a parse error for an SQL statement, please check your syntax closely. If you cannot find something wrong with it, it is extremely likely that your current version of MySQL Server doesn't support the syntax you are using. 如果您收到SQL语句的解析错误,请仔细检查您的语法。如果您找不到它的错误,那么很可能您当前版本的MySQL Server不支持您正在使用的语法。If you are using the current version and the manual doesn't cover the syntax that you are using, MySQL Server doesn't support your statement.如果您使用的是当前版本,并且手册没有涵盖您使用的语法,那么MySQL Server不支持您的声明。
If the manual covers the syntax you are using, but you have an older version of MySQL Server, you should check the MySQL change history to see when the syntax was implemented. In this case, you have the option of upgrading to a newer version of MySQL Server.如果手册涵盖了您正在使用的语法,但您有一个旧版本的MySQL Server,您应该查看MySQL的更改历史记录,看看该语法是何时实现的。在这种情况下,您可以选择升级到更新版本的MySQL Server。
For solutions to some common problems, see Section B.3, “Problems and Common Errors”.有关一些常见问题的解决方案,请参阅第B.3节,“问题和常见错误”。
Search the bugs database at http://bugs.mysql.com/ to see whether the bug has been reported and fixed.在http://bugs.mysql.com/上搜索Bug数据库以查看是否已报告并修复错误。
You can also use http://www.mysql.com/search/ to search all the Web pages (including the manual) that are located at the MySQL website.您也可以使用http://www.mysql.com/search/搜索MySQL网站上的所有网页(包括手册)。
If you cannot find an answer in the manual, the bugs database, or the mailing list archives, check with your local MySQL expert. If you still cannot find an answer to your question, please use the following guidelines for reporting the bug.如果您在手册、错误数据库或邮件列表档案中找不到答案,请咨询您当地的MySQL专家。如果您仍然找不到问题的答案,请使用以下指南报告错误。
The normal way to report bugs is to visit http://bugs.mysql.com/, which is the address for our bugs database. 报告错误的正常方式是访问http://bugs.mysql.com/,这是我们bug数据库的地址。This database is public and can be browsed and searched by anyone. If you log in to the system, you can enter new reports.这个数据库是公共的,任何人都可以浏览和搜索。如果您登录到系统,则可以输入新的报告。
Bugs posted in the bugs database at http://bugs.mysql.com/ that are corrected for a given release are noted in the release notes.位于http://bugs.mysql.com/的错误数据库中发布的错误在发行说明中注明了针对给定发行版更正的。
If you find a security bug in MySQL Server, please let us know immediately by sending an email message to 如果您在MySQL Server中发现安全漏洞,请立即发送电子邮件至<secalert_us@oracle.com>
. <secalert_us@oracle.com>
。Exception: Support customers should report all problems, including security bugs, to Oracle Support at http://support.oracle.com/.例外情况:支持客户应向Oracle支持部门报告所有问题,包括安全漏洞,网址为http://support.oracle.com/。
To discuss problems with other users, you can use the MySQL Community Slack.要与其他用户讨论问题,您可以使用MySQL社区Slack。
Writing a good bug report takes patience, but doing it right the first time saves time both for us and for yourself. 写一份好的bug报告需要耐心,但第一次做对就可以为我们和你自己节省时间。A good bug report, containing a full test case for the bug, makes it very likely that we will fix the bug in the next release. 一个好的bug报告,包含bug的完整测试用例,使我们很可能在下一个版本中修复bug。This section helps you write your report correctly so that you do not waste your time doing things that may not help us much or at all. Please read this section carefully and make sure that all the information described here is included in your report.本节帮助您正确撰写报告,这样您就不会浪费时间做对我们帮助不大或根本没有帮助的事情。请仔细阅读本节,并确保此处描述的所有信息都包含在您的报告中。
Preferably, you should test the problem using the latest production or development version of MySQL Server before posting. 最好,在发布之前,您应该使用MySQL Server的最新生产或开发版本来测试这个问题。Anyone should be able to repeat the bug by just using 任何人都应该能够通过在测试用例中使用mysql test < script_file
on your test case or by running the shell or Perl script that you include in the bug report. mysql test < script_file
,或者通过运行错误报告中包含的shell或Perl脚本来重复该错误。Any bug that we are able to repeat has a high chance of being fixed in the next MySQL release.我们能够重复的任何错误都很有可能在下一个MySQL版本中得到修复。
It is most helpful when a good description of the problem is included in the bug report. 当错误报告中包含对问题的良好描述时,这是最有帮助的。That is, give a good example of everything you did that led to the problem and describe, in exact detail, the problem itself. 也就是说,举一个很好的例子,说明你所做的导致问题的一切,并准确详细地描述问题本身。The best reports are those that include a full example showing how to reproduce the bug or problem. See Section 5.9, “Debugging MySQL”.最好的报告包括一个完整的示例,说明如何重现错误或问题。请参阅第5.9节,“调试MySQL”。
Remember that it is possible for us to respond to a report containing too much information, but not to one containing too little. People often omit facts because they think they know the cause of a problem and assume that some details do not matter. 请记住,我们可以对包含过多信息的报告作出回应,但不能对包含过少信息的报告做出回应。人们经常忽略事实,因为他们认为自己知道问题的原因,并认为一些细节无关紧要。A good principle to follow is that if you are in doubt about stating something, state it. It is faster and less troublesome to write a couple more lines in your report than to wait longer for the answer if we must ask you to provide information that was missing from the initial report.一个很好的原则是,如果你对陈述有疑问,就陈述出来。如果我们必须要求你提供最初报告中缺失的信息,那么在报告中多写几行比等待更长时间的答案更快、更不麻烦。
The most common errors made in bug reports are (a) not including the version number of the MySQL distribution that you use, and (b) not fully describing the platform on which the MySQL server is installed (including the platform type and version number). 错误报告中最常见的错误是(a)没有包括您使用的MySQL发行版的版本号,以及(b)没有完全描述安装MySQL服务器的平台(包括平台类型和版本号)。These are highly relevant pieces of information, and in 99 cases out of 100, the bug report is useless without them. 这些都是高度相关的信息,在百分之九十九的情况下,没有它们,错误报告就毫无用处。Very often we get questions like, “Why doesn't this work for me?” Then we find that the feature requested wasn't implemented in that MySQL version, or that a bug described in a report has been fixed in newer MySQL versions. 我们经常会遇到这样的问题:“为什么这对我不起作用?”然后我们发现请求的功能没有在那个MySQL版本中实现,或者报告中描述的错误已经在较新的MySQL版本中修复。Errors often are platform-dependent. In such cases, it is next to impossible for us to fix anything without knowing the operating system and the version number of the platform.错误通常取决于平台。在这种情况下,我们几乎不可能在不知道操作系统和平台版本号的情况下修复任何东西。
If you compiled MySQL from source, remember also to provide information about your compiler if it is related to the problem. Often people find bugs in compilers and think the problem is MySQL-related. Most compilers are under development all the time and become better version by version. To determine whether your problem depends on your compiler, we need to know what compiler you used. Note that every compiling problem should be regarded as a bug and reported accordingly.如果您从源代码编译MySQL,请记住,如果与问题有关,还应提供有关编译器的信息。人们经常在编译器中发现错误,并认为问题与MySQL有关。大多数编译器一直在开发中,并且一个版本接一个版本地变得更好。为了确定您的问题是否取决于您的编译器,我们需要知道您使用了什么编译器。请注意,每一个编译问题都应该被视为一个bug,并相应地进行报告。
If a program produces an error message, it is very important to include the message in your report. If we try to search for something from the archives, it is better that the error message reported exactly matches the one that the program produces. (Even the lettercase should be observed.) It is best to copy and paste the entire error message into your report. You should never try to reproduce the message from memory.如果程序生成错误消息,那么在报告中包含该消息是非常重要的。如果我们试图从档案中搜索某些内容,最好报告的错误消息与程序生成的错误消息完全匹配。(甚至要注意信纸。)最好将整个错误信息复制并粘贴到报告中。你永远不应该试图从记忆中重现信息。
If you have a problem with Connector/ODBC (MyODBC), please try to generate a trace file and send it with your report. See How to Report Connector/ODBC Problems or Bugs.如果连接器/ODBC(MyODBC)有问题,请尝试生成跟踪文件并将其与报告一起发送。请参阅如何报告连接器/ODBC问题或错误。
If your report includes long query output lines from test cases that you run with the mysql command-line tool, you can make the output more readable by using the 如果您的报告包含使用--vertical
option or the \G
statement terminator. mysql
命令行工具运行的测试用例的长查询输出行,则可以使用--vertical
选项或\G
语句终止符使输出更具可读性。The 本节后面的EXPLAIN SELECT
example later in this section demonstrates the use of \G
.EXPLAIN SELECT
示例演示了\G
。
Please include the following information in your report:请在您的报告中包括以下信息:
The version number of the MySQL distribution you are using (for example, MySQL 5.7.10). 您正在使用的MySQL发行版的版本号(例如,MySQL 5.7.10)。You can find out which version you are running by executing mysqladmin version. 您可以通过执行mysqladmin version
来找出您正在运行的版本。The mysqladmin program can be found in the bin
directory under your MySQL installation directory.mysqladmin
程序可以在MySQL安装目录下的bin目录中找到。
The manufacturer and model of the machine on which you experience the problem.您遇到问题的机器的制造商和型号。
The operating system name and version. 操作系统名称和版本。If you work with Windows, you can usually get the name and version number by double-clicking your My Computer icon and pulling down the “Help/About Windows” menu. 如果您使用Windows,通常可以通过双击“我的电脑”图标并下拉“帮助/关于Windows”菜单来获取名称和版本号。For most Unix-like operating systems, you can get this information by executing the command 对于大多数类Unix操作系统,您可以通过执行命令uname -a
.uname -a
来获得这些信息。
Sometimes the amount of memory (real and virtual) is relevant. If in doubt, include these values.有时内存量(真实内存和虚拟内存)是相关的。如果有疑问,请包括这些值。
The contents of the MySQL安装中的docs/INFO_BIN
file from your MySQL installation. This file contains information about how MySQL was configured and compiled.docs/INFO_BIN
文件的内容。此文件包含有关如何配置和编译MySQL的信息。
If you are using a source distribution of the MySQL software, include the name and version number of the compiler that you used. If you have a binary distribution, include the distribution name.如果您使用的是MySQL软件的源发行版,请包括您使用的编译器的名称和版本号。如果您有二进制分发,请包括分发名称。
If the problem occurs during compilation, include the exact error messages and also a few lines of context around the offending code in the file where the error occurs.如果问题发生在编译过程中,请在发生错误的文件中包含确切的错误消息以及有关违规代码的几行上下文。
If mysqld died, you should also report the statement that caused mysqld to unexpectedly exit. 如果mysqld已经死亡,您还应该报告导致mysqld意外退出的语句。You can usually get this information by running mysqld with query logging enabled, and then looking in the log after mysqld exits. 您通常可以通过在启用查询日志记录的情况下运行mysqld,然后在mysqld退出后查看日志来获取这些信息。See Section 5.9, “Debugging MySQL”.请参阅第5.9节,“调试MySQL”。
If a database table is related to the problem, include the output from the 如果数据库表与问题有关,请在错误报告中包括SHOW CREATE TABLE
statement in the bug report. db_name
.tbl_name
SHOW CREATE table db_name.tbl_name
语句的输出。This is a very easy way to get the definition of any table in a database. The information helps us create a situation matching the one that you have experienced.这是获取数据库中任何表的定义的一种非常简单的方法。这些信息可以帮助我们创建一个与您所经历的情况相匹配的情况。
The SQL mode in effect when the problem occurred can be significant, so please report the value of the 问题发生时有效的SQL模式可能很重要,因此请报告sql_mode
system variable. sql_mode
系统变量的值。For stored procedure, stored function, and trigger objects, the relevant 对于存储过程、存储函数和触发器对象,相关的sql_mode
value is the one in effect when the object was created. sql_mode
值是创建对象时有效的值。For a stored procedure or function, the 对于存储过程或函数,SHOW CREATE PROCEDURE
or SHOW CREATE FUNCTION
statement shows the relevant SQL mode, or you can query INFORMATION_SCHEMA
for the information:SHOW CREATE PROCEDURE
或SHOW CREATE FUNCTION
语句显示相关的SQL模式,或者您可以查询INFORMATION_SCHEMA
以获取信息:
SELECT ROUTINE_SCHEMA, ROUTINE_NAME, SQL_MODE FROM INFORMATION_SCHEMA.ROUTINES;
For triggers, you can use this statement:对于触发器,您可以使用以下语句:
SELECT EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE, TRIGGER_NAME, SQL_MODE FROM INFORMATION_SCHEMA.TRIGGERS;
For performance-related bugs or problems with 对于与性能相关的错误或SELECT
statements, you should always include the output of EXPLAIN SELECT ...
, and at least the number of rows that the SELECT
statement produces. SELECT
语句的问题,您应该始终包括EXPLAIN SELECT ...
的输出,以及至少SELECT
语句生成的行数。You should also include the output from 您还应该为所涉及的每个表包括SHOW CREATE TABLE
for each table that is involved. tbl_name
SHOW CREATE TABLE tbl_name
的输出。The more information you provide about your situation, the more likely it is that someone can help you.你提供的关于你的情况的信息越多,就越有可能有人能帮助你。
The following is an example of a very good bug report. The statements are run using the mysql command-line tool. 以下是一个非常好的错误报告示例。这些语句是使用mysql命令行工具运行的。Note the use of the 请注意,对于那些提供很长且难以读取的输出行的语句,请使用\G
statement terminator for statements that would otherwise provide very long output lines that are difficult to read.\G
语句终止符。
mysql>SHOW VARIABLES;
mysql>SHOW COLUMNS FROM ...\G
<output from SHOW COLUMNS>
mysql>EXPLAIN SELECT ...\G
<output from EXPLAIN>
mysql>FLUSH STATUS;
mysql>SELECT ...;
<A short version of the output from SELECT, including the time taken to run the query>
mysql>SHOW STATUS;
<output from SHOW STATUS>
If a bug or problem occurs while running mysqld, try to provide an input script that reproduces the anomaly. 如果在运行mysqld时出现错误或问题,请尝试提供一个能重现异常的输入脚本。This script should include any necessary source files. 此脚本应包括任何必要的源文件。The more closely the script can reproduce your situation, the better. If you can make a reproducible test case, you should upload it to be attached to the bug report.脚本越能准确地再现你的情况越好。如果你能制作一个可复制的测试用例,你应该把它上传到错误报告中。
If you cannot provide a script, you should at least include the output from mysqladmin variables extended-status processlist in your report to provide some information on how your system is performing.如果无法提供脚本,则至少应在报告中包含mysqladmin变量扩展状态处理列表的输出,以提供有关系统运行情况的一些信息。
If you cannot produce a test case with only a few rows, or if the test table is too big to be included in the bug report (more than 10 rows), you should dump your tables using mysqldump and create a 如果您不能生成只有几行的测试用例,或者测试表太大而无法包含在错误报告中(超过10行),则应该使用mysqldump转储表,并创建一个自述文件来描述您的问题。README
file that describes your problem. Create a compressed archive of your files using tar and gzip or zip. 使用tar和gzip或zip创建文件的压缩存档。After you initiate a bug report for our bugs database at http://bugs.mysql.com/, click the Files tab in the bug report for instructions on uploading the archive to the bugs database.在您为位于http://bugs.mysql.com/的错误数据库启动错误报告后,单击错误报告中的“文件”选项卡以获取有关将存档上载到错误数据库的说明。
If you believe that the MySQL server produces a strange result from a statement, include not only the result, but also your opinion of what the result should be, and an explanation describing the basis for your opinion.如果你认为MySQL服务器从一个语句中产生了一个奇怪的结果,那么不仅要包括结果,还要包括你对结果应该是什么的看法,以及描述你的看法的基础的解释。
When you provide an example of the problem, it is better to use the table names, variable names, and so forth that exist in your actual situation than to come up with new names. 当您提供问题的示例时,最好使用实际情况中存在的表名、变量名等,而不是使用新名称。The problem could be related to the name of a table or variable. These cases are rare, perhaps, but it is better to be safe than sorry. 问题可能与表或变量的名称有关。这种情况可能很少见,但安全总比抱歉好。After all, it should be easier for you to provide an example that uses your actual situation, and it is by all means better for us. If you have data that you do not want to be visible to others in the bug report, you can upload it using the Files tab as previously described. 毕竟,您应该更容易提供一个使用您实际情况的示例,而且这对我们来说绝对更好。如果您有不想在错误报告中被其他人看到的数据,您可以使用前面描述的“文件”选项卡上传。If the information is really top secret and you do not want to show it even to us, go ahead and provide an example using other names, but please regard this as the last choice.如果这些信息真的是绝密信息,而您甚至不想向我们展示,请继续使用其他名称提供一个示例,但请将此视为最后的选择。
Include all the options given to the relevant programs, if possible. 如果可能的话,包括提供给相关项目的所有选项。For example, indicate the options that you use when you start the mysqld server, as well as the options that you use to run any MySQL client programs. 例如,指示启动mysqld服务器时使用的选项,以及用于运行任何MySQL客户端程序的选项。The options to programs such as mysqld and mysql, and to the configure script, are often key to resolving problems and are very relevant. mysqld和mysql等程序以及配置脚本的选项通常是解决问题的关键,并且非常相关。It is never a bad idea to include them. 把它们包括在内从来都不是一个坏主意。If your problem involves a program written in a language such as Perl or PHP, please include the language processor's version number, as well as the version for any modules that the program uses. 如果您的问题涉及用Perl或PHP等语言编写的程序,请包括语言处理器的版本号,以及该程序使用的任何模块的版本。For example, if you have a Perl script that uses the 例如,如果您有一个使用DBI
and DBD::mysql
modules, include the version numbers for Perl, DBI
, and DBD::mysql
.DBI
和DBD::mysql
模块的Perl脚本,请包括Perl、DBI
和DBD::mysql
的版本号。
If your question is related to the privilege system, please include the output of mysqladmin reload, and all the error messages you get when trying to connect. 如果您的问题与特权系统有关,请包括mysqladmin重载的输出,以及您在尝试连接时收到的所有错误消息。When you test your privileges, you should execute mysqladmin reload version and try to connect with the program that gives you trouble.当您测试您的权限时,您应该执行mysqladmin重载版本,并尝试连接给您带来麻烦的程序。
If you have a patch for a bug, do include it. But do not assume that the patch is all we need, or that we can use it, if you do not provide some necessary information such as test cases showing the bug that your patch fixes. 如果你有一个bug的补丁,一定要包括它。但是,如果你没有提供一些必要的信息,比如显示你的补丁修复的bug的测试用例,不要认为这个补丁就是我们所需要的,或者我们可以使用它。We might find problems with your patch or we might not understand it at all. If so, we cannot use it.我们可能会发现您的补丁有问题,或者我们可能根本不了解它。如果是这样,我们就不能使用它。
If we cannot verify the exact purpose of the patch, we will not use it. Test cases help us here. Show that the patch handles all the situations that may occur. If we find a borderline case (even a rare one) where the patch will not work, it may be useless.如果我们无法验证补丁的确切用途,我们将不会使用它。测试案例在这里帮助我们。显示修补程序可处理所有可能发生的情况。如果我们发现补丁不起作用的临界情况(即使是罕见的情况),它可能毫无用处。
Guesses about what the bug is, why it occurs, or what it depends on are usually wrong. Even the MySQL team cannot guess such things without first using a debugger to determine the real cause of a bug.对错误是什么、为什么会发生或依赖于什么的猜测通常是错误的。如果不首先使用调试器来确定错误的真正原因,即使是MySQL团队也无法猜测这些事情。
Indicate in your bug report that you have checked the reference manual and mail archive so that others know you have tried to solve the problem yourself.在错误报告中指出您已经检查了参考手册和邮件档案,以便其他人知道您已尝试自己解决问题。
If your data appears corrupt or you get errors when you access a particular table, first check your tables with 如果您的数据似乎已损坏,或者在访问特定表时出现错误,请首先使用CHECK TABLE
. CHECK TABLE
检查表。If that statement reports any errors:如果该语句报告了任何错误:
The InnoDB
crash recovery mechanism handles cleanup when the server is restarted after being killed, so in typical operation there is no need to “repair” tables. InnoDB
崩溃恢复机制在服务器被终止后重新启动时处理清理,因此在典型的操作中不需要“修复”表。If you encounter an error with 如果您在InnoDB
tables, restart the server and see whether the problem persists, or whether the error affected only cached data in memory. InnoDB
表中遇到错误,请重新启动服务器,看看问题是否仍然存在,或者错误是否只影响内存中的缓存数据。If data is corrupted on disk, consider restarting with the 如果磁盘上的数据已损坏,请考虑在启用innodb_force_recovery
option enabled so that you can dump the affected tables.innodb_force_recovery
选项的情况下重新启动,以便转储受影响的表。
For non-transactional tables, try to repair them with 对于非事务性表,请尝试使用REPAIR TABLE
or with myisamchk. REPAIR TABLE
或myisamchk修复它们。See Chapter 5, MySQL Server Administration.请参阅第5章,MySQL服务器管理。
If you are running Windows, please verify the value of 如果您运行的是Windows,请使用lower_case_table_names
using the SHOW VARIABLES LIKE 'lower_case_table_names'
statement. SHOW VARIABLES LIKE 'lower_case_table_names'
语句验证lower_case_table_names
的值。This variable affects how the server handles lettercase of database and table names. 此变量影响服务器如何处理数据库和表名称的大小写。Its effect for a given value should be as described in Section 9.2.3, “Identifier Case Sensitivity”.其对给定值的影响应如第9.2.3节,“标识符大小写敏感性”所述。
If you often get corrupted tables, you should try to find out when and why this happens. 如果你经常得到损坏的表,你应该试着找出这种情况发生的时间和原因。In this case, the error log in the MySQL data directory may contain some information about what happened. 在这种情况下,MySQL数据目录中的错误日志可能包含一些关于发生了什么的信息。(This is the file with the (这是名称中带有.err
suffix in the name.) See Section 5.4.2, “The Error Log”. .err
后缀的文件。)参见第5.4.2节,“错误日志”。Please include any relevant information from this file in your bug report. 请在您的错误报告中包含此文件中的任何相关信息。Normally mysqld should never corrupt a table if nothing killed it in the middle of an update. 通常情况下,如果在更新过程中没有任何东西杀死表,那么mysqld永远不应该损坏表。If you can find the cause of mysqld dying, it is much easier for us to provide you with a fix for the problem. 如果你能找到mysqld死亡的原因,我们会更容易为你提供问题的解决方案。See Section B.3.1, “How to Determine What Is Causing a Problem”.请参阅第B.3.1节,“如何确定问题的原因”。
If possible, download and install the most recent version of MySQL Server and check whether it solves your problem. 如果可能,请下载并安装最新版本的MySQL Server,并检查它是否解决了您的问题。All versions of the MySQL software are thoroughly tested and should work without problems. MySQL软件的所有版本都经过了彻底的测试,应该可以正常工作。We believe in making everything as backward-compatible as possible, and you should be able to switch MySQL versions without difficulty. 我们相信要使所有东西尽可能向后兼容,并且您应该能够毫无困难地切换MySQL版本。See Section 2.1.2, “Which MySQL Version and Distribution to Install”.请参阅第2.1.2节,“安装哪个MySQL版本和发行版”。