19.1 行政顾问

本节介绍基于表达式的 Administration Advisor。

在 64 位 AMD 或 Intel 系统上运行的 32 位二进制文​​件

如果检测到 32 位二进制文​​件在 64 位平台上运行,则引发事件。大多数 32 位二进制文​​件可以在 64 位平台上运行。但是,出于性能原因,建议在 64 位平台上运行 64 位二进制文​​件,在 32 位平台上运行 32 位二进制文​​件。

默认频率06:00:00

默认自动关闭启用

禁用二进制日志调试信息

二进制日志捕获发生的 DML、DDL 和安全更改,并以二进制格式存储这些更改。二进制日志支持时间点恢复,防止在灾难恢复情况下丢失数据。它还使您能够查看对数据库所做的所有更改。

二进制日志信息事件用于调试和相关目的。通过设置 binlog_rows_query_log_events为 启用信息事件TRUE。默认情况下,如果启用了 ROW 或 MIXED 日志记录并且 binlog_rows_query_log_events=FALSE.

笔记

二进制日志信息事件是在 MySQL 5.6.2 中引入的,早期版本的 MySQL 不支持。

默认频率06:00:00

默认自动关闭是否启用

二进制日志记录是有限的

二进制日志捕获发生的 DML、DDL 和安全更改,并以二进制格式存储这些更改。二进制日志支持时间点恢复,防止在灾难恢复情况下丢失数据。它还使您能够查看对数据库所做的所有更改。

可以使用 --binlog-do-db--binlog-ignore-db选项将二进制日志记录限制为特定数据库。但是,如果使用这些选项,您的时间点恢复选项将受到相应限制,同时您查看对系统所做更改的能力也会受到限制。

默认频率06:00:00

默认自动关闭启用

未启用二进制日志记录

二进制日志捕获 DML、DDL 和安全更改,并以二进制格式存储这些更改。二进制日志支持时间点恢复,防止在灾难恢复情况下丢失数据。它还使您能够查看对数据库所做的所有更改。

默认频率06:00:00

默认自动关闭启用

每次写入时二进制日志记录未同步到磁盘

默认情况下,二进制日志内容不会同步到磁盘。如果服务器主机或操作系统崩溃,二进制日志中的最新事件有可能不会保存在磁盘上。sync_binlog您可以使用服务器变量更改此行为 。如果这个变量的值大于0,MySQL服务器会 在提交组写入二进制日志fdatasync()后将其二进制日志同步到磁盘(使用) 。sync_binlog默认值sync_binlog 为 0,不同步到磁盘 - 在这种情况下,服务器依赖操作系统不时刷新二进制日志的内容,就像任何其他文件一样。值 1 是最安全的选择,因为在发生崩溃时,您最多会从二进制日志中丢失一个提交组。然而,它也是最慢的选择(除非磁盘有电池备份缓存,这使得同步非常快)。

默认频率06:00:00

默认自动关闭是否启用

二进制日志自动删除太快

二进制日志捕获发生的 DML、DDL 和安全更改,并以二进制格式存储这些更改。二进制日志支持时间点恢复,防止在灾难恢复情况下丢失数据。它在主复制服务器上用作要发送到从服务器的语句的记录。它还使您能够查看对数据库所做的所有更改。

但是,日志文件的数量和它们使用的空间会迅速增长,尤其是在繁忙的服务器上,因此只要已进行适当的备份,就必须在不再需要时定期删除这些文件。该 expire_logs_days参数启用自动二进制日志删除。

默认频率12:00:00

默认自动关闭启用

由于标识符区分大小写,数据库可能不可移植

底层操作系统的大小写敏感性决定了数据库和表名的大小写敏感性。如果您只在一个平台上使用 MySQL,您通常不必担心这一点。但是,根据您配置服务器的方式,如果您想要在文件系统区分大小写不同的平台之间传输表,您可能会遇到困难。

默认频率06:00:00

默认自动关闭启用

事件调度程序已禁用

Event Scheduler 是一个框架,用于在特定时间或定期执行 SQL 命令,类似于 Unix crontab 或 Windows Task Scheduler。

事件是具有开始日期和时间以及循环标记的存储例程。与触发器不同,事件不链接到特定的表操作,而是链接到日期和时间。常见用途是清理过时数据、创建统计摘要表以及监控服务器性能和使用情况。

默认频率00:05:00

默认自动关闭启用

启用一般查询日志

The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.

However, the general query log should not be enabled in production environments because:

  • It adds overhead to the server;

  • It logs statements in the order they were received, not the order they were executed, so it is not reliable for backup/recovery;

  • It grows quickly and can use a lot of disk space;

Default frequency 06:00:00

Default auto-close enabled yes

Host Cache Size Not Sufficient

The MySQL server maintains a host cache in memory that contains IP address, host name, and error information about clients. It uses the host cache for several purposes:

  • By caching the results of IP-to-host name lookups, the server avoids doing a DNS lookup for each client connection, thereby improving performance.

  • The cache contains information about errors that occur during the connection process. Some errors are considered blocking. If too many of these occur successively from a given host without a successful connection, the server blocks further connections from that host.

    If the host cache is not large enough to handle all the hosts from which clients may connect, performance may suffer and you may lose information about client connection errors.

Default frequency 00:05:00

Default auto-close enabled no

In-Memory Temporary Table Size Limited By Maximum Heap Table Size

If the space required to build a temporary table exceeds either tmp_table_size or max_heap_table_size, MySQL creates a disk-based table in the server's temp directory. For performance reasons it is recommended to have most temporary tables created in memory, and only create large temporary tables on disk.

Default frequency 06:00:00

Default auto-close enabled yes

InnoDB Status Truncation Detected

InnoDB primarily uses the SHOW ENGINE INNODB STATUS command to dump diagnostics information. As this SHOW statement can output a lot of data when running in a system with very many concurrent sessions, the output is limited to 64 kilobytes in versions < 5.5.7, and 1 megabyte on versions greater than 5.5.7. You are running a version where the truncation limit should be 1 megabyte, however truncation is still occurring in your system, and the MEM Agent relies on this output to pass back a number of key InnoDB statistics.

However, InnoDB provides a start up option called innodb-status-file, which dumps the same output as SHOW ENGINE INNODB STATUS to a file called innodb_status.mysql pid in the datadir. MySQL Enterprise Monitor Agent reads this file automatically, if it exists, before executing the SHOW statement.

For more information, see SHOW ENGINE Statement.

Default frequency 00:05:00

Default auto-close enabled no

InnoDB Strict Mode Is Off

To guard against ignored typos and syntax errors in SQL, or other unintended consequences of various combinations of operational modes and SQL commands, InnoDB provides a strict mode of operations. In this mode, InnoDB raises error conditions in certain cases, rather than issue a warning and process the specified command. This is analogous to sql_mode, which controls what SQL syntax MySQL accepts, and determines whether it silently ignores errors, or validates input syntax and data values.

Using the new clauses and settings for ROW_FORMAT and KEY_BLOCK_SIZE on CREATE TABLE and ALTER TABLE commands and the CREATE INDEX command can be confusing when not running in strict mode. Unless you run in strict mode, InnoDB ignores certain syntax errors and creates the table or index, with only a warning in the message log. However if InnoDB strict mode is on, such errors generate an immediate error and the table or index is not created, saving time by catching the error at the time the command is issued.

Default frequency 12:00:00

Default auto-close enabled yes

InnoDB Tablespace Cannot Automatically Expand

If the InnoDB tablespace is not allowed to automatically grow to meet incoming data demands and your application generates more data than there is room for, out-of-space errors occur and your application may experience problems.

Default frequency 06:00:00

Default auto-close enabled yes

InnoDB Transaction Logs Not Sized Correctly

To avoid frequent checkpoint activity and reduce overall physical I/O, which can slow down write-heavy systems, the InnoDB transaction logs should be approximately 50-100% of the size of the InnoDB buffer pool, depending on the size of the buffer pool.

Default frequency 06:00:00

Default auto-close enabled yes

Multiple Threads Used When Repairing MyISAM Tables

Using multiple threads when repairing MyISAM tables can improve performance, but it can also lead to table and index corruption.

Default frequency 06:00:00

Default auto-close enabled yes

MySQL Server No Longer Eligible For Oracle Premier Support

To ensure you are running versions of MySQL which are still covered by their support contracts, this advisor checks for MySQL versions which are no longer eligible for Premier support cover. Specifically for versions 5.1 and 5.5.

The default thresholds are defined in a numeric format, where version 5.5 is represented as 50500 (Notice threshold), and 5.1 as 50100 (Warning threshold).

Default frequency 06:00:00

Default auto-close enabled yes

Next-Key Locking Disabled For InnoDB But Binary Logging Enabled

Note

This advisor does not evaluate against MySQL 8, or higher.

Next-key locking in InnoDB can be disabled, which may improve performance in some situations. However, this may result in inconsistent data when recovering from the binary logs in replication or recovery situations. You can disable most gap locks, including most next-key locks, by using --transaction-isolation=READ-COMMITTED or --innodb_locks_unsafe_for_binlog=1. Using either is perfectly safe, but only if you are also using --binlog-format=ROW.

Default frequency 06:00:00

Default auto-close enabled yes

No Value Set For MyISAM Recover Options

The myisam_recover_options system variable (the myisam-recover option before MySQL 5.5.3) enables automatic MyISAM crash recovery should a MyISAM table become corrupt for some reason. If this option is not set, then a table is be Marked as crashed, if it becomes corrupt, and no sessions can SELECT from it, or perform any sort of DML against it.

Default frequency 06:00:00

Default auto-close enabled yes

Table Cache Set Too Low For Startup

The table cache size controls the number of open tables that can occur at any one time on the server. MySQL works to open and close tables as needed, however you should avoid having the table cache set too low, causing MySQL to constantly open and close tables to satisfy object access.

If the table cache limit has been exceeded by the number of tables opened in the first three hours of service, then the table cache size is likely set too low.

Default frequency 00:30:00

Default auto-close enabled yes

Time Zone Data Not Loaded

The MySQL server supports multiple time zones and provides various date and time functions, including a function that converts a date-time value from one time zone to another (CONVERT_TZ). However, while the MySQL installation procedure creates the time zone tables in the mysql database, it does not load them; you must do so manually after installation. If the time zone tables are not loaded, certain time zone functions such as CONVERT_TZ do not work.

Default frequency 12:00:00

Default auto-close enabled yes

Warnings Not Being Logged

Note

This advisor does not evaluate against MySQL 8, or higher.

MySQL 服务器遇到的错误情况总是记录在错误日志中,但警告情况仅在 log_warnings设置为大于 0 的值时才会记录。如果未记录警告,则不会获得有关中止连接和各种其他通信错误的有价值信息. 如果您使用复制,这一点尤其重要,这样您可以获得有关正在发生的事情的更多信息,例如有关网络故障和重新连接的消息。

默认频率12:00:00

默认自动关闭启用