无法连接到 MySQL(SSL 和授权问题) - Amazon QuickSight
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

无法连接到 MySQL(SSL 和授权问题)

要检查 MySQL 中的一些常见连接问题,请使用以下步骤。该过程将帮助您了解是否已启用 SSL 并授予使用权限。

查找 MySQL 中一些常见连接问题的解决方案
  1. 检查 /etc/my.cnf 确保已为 MySQL 启用 SSL。

  2. 在 MySQL 中,运行以下命令。

    show status like 'Ssl%';

    如果 SSL 正在运行,将看到类似于下面的结果。

    +--------------------------------+----------------------+ | Variable_name | Value | +--------------------------------+----------------------+ | Ssl_accept_renegotiates | 0 | | Ssl_accepts | 1 | | Ssl_callback_cache_hits | 0 | | Ssl_cipher | | | Ssl_cipher_list | | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_ctx_verify_depth | 18446744073709551615 | | Ssl_ctx_verify_mode | 5 | | Ssl_default_timeout | 0 | | Ssl_finished_accepts | 0 | | Ssl_finished_connects | 0 | | Ssl_session_cache_hits | 0 | | Ssl_session_cache_misses | 0 | | Ssl_session_cache_mode | SERVER | | Ssl_session_cache_overflows | 0 | | Ssl_session_cache_size | 128 | | Ssl_session_cache_timeouts | 0 | | Ssl_sessions_reused | 0 | | Ssl_used_session_cache_entries | 0 | | Ssl_verify_depth | 0 | | Ssl_verify_mode | 0 | | Ssl_version | | +--------------------------------+----------------------+

    如果 SSL 已禁用,将看到类似于下面的结果。

    +--------------------------------+-------+ | Variable_name | Value | +--------------------------------+-------+ | Ssl_accept_renegotiates | 0 | | Ssl_accepts | 0 | | Ssl_callback_cache_hits | 0 | | Ssl_cipher | | | Ssl_cipher_list | | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_ctx_verify_depth | 0 | | Ssl_ctx_verify_mode | 0 | | Ssl_default_timeout | 0 | | Ssl_finished_accepts | 0 | | Ssl_finished_connects | 0 | | Ssl_session_cache_hits | 0 | | Ssl_session_cache_misses | 0 | | Ssl_session_cache_mode | NONE | | Ssl_session_cache_overflows | 0 | | Ssl_session_cache_size | 0 | | Ssl_session_cache_timeouts | 0 | | Ssl_sessions_reused | 0 | | Ssl_used_session_cache_entries | 0 | | Ssl_verify_depth | 0 | | Ssl_verify_mode | 0 | | Ssl_version | | +--------------------------------+-------+
  3. 确保已在数据库服务器上安装支持的 SSL 证书。

  4. 授予特定用户使用 SSL 连接的权限。

    GRANT USAGE ON *.* TO 'encrypted_user'@'%' REQUIRE SSL;

有关本例中的解决方案的更多详细信息,请参阅以下内容: