【问题标题】:Having trouble to connect to (remote) MySQL database with MySQLWorkbench无法使用 MySQL Workbench 连接到(远程)MySQL 数据库
【发布时间】:2016-07-24 10:33:04
【问题描述】:

我使用的是装有 macOS 10.11.6 的 Mac。我想将 MySQLWorkbench 6.3.7 连接到存储在我的 Linux 服务器上的 MySQL 数据库。我能够创建与 Sequel Pro 的连接,但它在 MySQLWorkbench 中做同样的事情不起作用。这就是我正在做的事情:

1. Open "Setup New Connection" window
2. Selecting "Standard TCP/IP over SSH"
3. SSH Hostname = my servers IP
4. SSH Username = same I use to login in MySQL database with PHPMyAdmin
5. SSH Password = same I use to login in MySQL database with PHPMyAdmin
6. SSH Key File = I do nothing here, stays empty
7. MySQL Hostname = my servers IP
8. MySQL Server Port = I do nothing here, stays empty
9. Username = same I use to login in MySQL database with PHPMyAdmin
10. Password = this is the password I also use to access my server with the FTP client
11. Default Schema = I do nothing here, stays empty

点击“测试连接”时,我得到:

Please enter password for the following service:
Service: Mysql@MY_IP:3306@MY_IP
User: MY_USERNAME

当我输入密码时,我得到:

Failed to Connect to MySQL at MY_IP:3306 through SSH tunnel at MY_USERNAME@MY_IP with user MY_USERNAME
Can't connect to MySQL server on '127.0.0.1' (61)

我做错了什么?有人可以帮帮我吗?

附:我用 MY_IP 和 MY_USERNAME 替换了 IP 和用户名。

【问题讨论】:

    标签: mysql mysql-workbench


    【解决方案1】:

    首先,确保您的远程服务器已启用 ssh。

    其次,假设它确实启用了 SSH,通常 SSH 用户名和 MySQL 用户名会不同(出于安全原因)。无论如何,请确保您拥有正确的 SSH 用户名/密码(听起来您已经拥有正确的 MySQL 用户名/密码)。

    第三:

    4. SSH Username = same I use to login in MySQL database with PHPMyAdmin
       - See above
    5. SSH Password = same I use to login in MySQL database with PHPMyAdmin
       - See above
    7. MySQL Hostname = my servers IP
       - Usually the value for this is either localhost or 127.0.0.1 - try either of
         those and see what happens.
    

    就个人而言,我尝试升级我的 MySQL Workbench 版本(使用 OSX),但我遇到了问题,所以我不得不下载以前的版本。唯一对我有用的是here。如果我上面提出的任何建议都不适合您,请尝试删除您当前的版本并下载较早的版本,看看是否是导致问题的原因。

    【讨论】:

    • 嗨,它与localhost 一起工作,就像MySQL Hostname。但还是有问题。我有三个数据库。所有都显示在左侧栏中。但是表格没有显示出来。我得到:Tables could not be fetched。在动作输出窗口中我得到:11:13:09 Error loading schema content Error Code: 1558 Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50051, now running 50173. Please use mysql_upgrade to fix this error. 当我使用mysql_upgrade 时会发生什么?我不想破坏一些东西。还有,怎么用?
    • @David 这本身就是一个完全不同的问题......发布一个新问题或做一些研究会更好,但无论哪种方式,如果你'能够(在升级之前)。
    猜你喜欢
    • 2018-01-19
    • 2015-09-13
    • 2020-04-08
    • 2021-01-05
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多