8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 8 安全 / 8.3 使用加密连接 / 8.3.4 使用 SSH 从 Windows 远程连接 MySQL
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

8.3.4 使用 SSH 从 Windows 远程连接 MySQL8.3.4 Connecting to MySQL Remotely from Windows with SSH

本节介绍如何通过 SSH 获取到远程 MySQL 服务器的加密连接。信息由 David Carlson 提供 。This section describes how to get an encrypted connection to a remote MySQL server with SSH. The information was provided by David Carlson .

  1. 在你的 Windows 机器上安装 SSH 客户端。有关 SSH 客户端的比较,请参见 http://en.wikipedia.org/wiki/Comparison_of_SSH_clients。Install an SSH client on your Windows machine. For a comparison of SSH clients, see http://en.wikipedia.org/wiki/Comparison_of_SSH_clients.

  2. 启动您的 Windows SSH 客户端。设置 Host_Name = yourmysqlserver_URL_or_IP。设置 userid=your_userid 来登录您的服务器。此 userid 值可能与您的 MySQL 账户用户名不同。Start your Windows SSH client. Set Host_Name = yourmysqlserver_URL_or_IP. Set userid=your_userid to log in to your server. This userid value might not be the same as the user name of your MySQL account.

  3. 设置端口转发。可以执行远程转发(设置 local_port: 3306,remote_host: yourmysqlservername_or_ip,remote_port: 3306)或本地转发(设置 port: 3306,host: localhost,remote port: 3306)。Set up port forwarding. Either do a remote forward (Set local_port: 3306, remote_host: yourmysqlservername_or_ip, remote_port: 3306 ) or a local forward (Set port: 3306, host: localhost, remote port: 3306).

  4. 保存所有内容,否则下次必须重新做。Save everything, otherwise you must redo it the next time.

  5. 使用您刚创建的 SSH 会话登录到您的服务器。Log in to your server with the SSH session you just created.

  6. 在您的 Windows 机器上,启动一些 ODBC 应用程序(例如 Access)。On your Windows machine, start some ODBC application (such as Access).

  7. 在 Windows 中创建一个新文件,并使用 ODBC 驱动程序连接到 MySQL,就像你平常做的那样,只是要在 MySQL 主机服务器中输入 localhost,而不是 yourmysqlservername。Create a new file in Windows and link to MySQL using the ODBC driver the same way you normally do, except type in localhost for the MySQL host server, not yourmysqlservername.

此时,您应该已经有一个通过 SSH 加密的到 MySQL 的 ODBC 连接。At this point, you should have an ODBC connection to MySQL, encrypted using SSH.