无法使用ssh connection

时间:2015-09-02 14:18:28

标签: mysql ssh

这是我第一次发布stackoverflow,我搜索了论坛但找不到任何答案。我在设置MySQL服务器,与MySQL服务器的ssh连接以及MySQL Workbench方面都是全新的。有3台运行Workbench CE(版本6.3)的Windows PC和一台运行MySQL CE的Ubuntu Linux PC。服务器和PC位于家庭网络上。服务器的IP地址是192.168.1.215; PC的ip地址是动态的。每台PC都收到相同的错误消息。 MySQL服务器是在Linux Ubuntu服务器上设置的。我可以使用Windows PC中的Putty从Windows登录MySQL。


在Workbench中,我为服务器设置了端口地址3306。尝试使用MySQL Workbench

连接到MySQL服务器时收到此错误消息
Could not connect the SSH Tunnel 
Authentication error, unhandled exception caught in in 
tunnel manager, please refer to logs for details 

我在Windows PC上找到了日志文件wb.log。 wb.log超过100行,我附上最后25行,显示错误信息。

10:34:12 [INF][ WBContext]: System info: 
MySQL Workbench Community (GPL) for Windows version 6.3.4 revision 0 build 828 (64 bit) 
Configuration Directory: C:\Users\Daddio\AppData\Roaming\MySQL\Workbench 
Data Directory: C:\Program Files\MySQL\MySQL Workbench 6.3 CE 
Cairo Version: 1.10.2 
OS: Microsoft Windows 7 Professional Service Pack 1 
CPU: 8x Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz, 32.0 GiB RAM 
Active video adapter ATI Radeon HD 4800 Series 
Installed video RAM: 1024 MB 
Current video mode: 1280 x 1024 x 4294967296 colors 
Used bit depth: 32 
Driver version: 8.920.0.0 
Installed display drivers: 
aticfx64.dll,aticfx64.dll,aticfx32,aticfx32,atiumd64.dll,atidxx64.dll,atiumdag,atidxx32,atiumdva,atiumd6a.cap,atitmm64.dll 
Current user language: English (United States) 

10:34:12 [INF][ Workbench]: UI is up 
10:34:12 [INF][ Workbench]: Running the application 
10:34:14 [INF][ SSH tunnel]: Starting tunnel 
10:34:14 [INF][ SSH tunnel]: Existing SSH tunnel not found, opening new one 
10:35:55 [INF][ SSH tunnel]: Opening SSH tunnel to 192.168.1.215:3306 
10:35:55 [WRN][sshtunnel.py:_connect_ssh:288]: IOError, probably caused by file C:\Users\Daddio\AppData\Roaming\MySQL\Workbench\ssh\known_hosts not found, the message was: [Errno 2] No such file or directory: u'C:\\Users\\Daddio\\AppData\\Roaming\\MySQL\\Workbench\\ssh\\known_hosts' 
10:35:55 [ERR][sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last): 
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\sshtunnel.py", line 298, in _connect_ssh 
look_for_keys=has_key, allow_agent=has_key) 
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\client.py", line 301, in connect 
t.start_client() 
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\transport.py", line 461, in start_client 
raise e 
SSHException: Error reading SSH protocol banner[Errno 10053] An established connection was aborted by the software in your host machine 

10:35:56 [INF][ SSH tunnel]: TunnelManager.wait_connection authentication error: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details 
10:35:56 [ERR][ SSH tunnel]: Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details 
10:37:26 [INF][ WBContext]: Connection to LINUXSERVER cancelled by user: Tunnel connection cancelled 
10:37:29 [INF][ Workbench]: Shutting down Workbench 
10:37:29 [INF][ mforms managed]: Shutting down mforms wrapper 
10:37:29 [INF][ Workbench]: Done 

4 个答案:

答案 0 :(得分:5)

如果您正在使用Ubuntu,则可能需要手动更新MySQL Workbench的版本。这是6.0.8版中的一个错误,它目前是Ubuntu存储库中的错误。更新到版本6.3.6为我修复了这个问题。

在此处下载:http://dev.mysql.com/downloads/workbench/#downloads

答案 1 :(得分:1)

当我更新mysql-workbench时,我遇到了这个问题。你需要做的是通过pip升级paramiko。

pip install --upgrade pip
pip install paramiko

这将安装使用ssh tunnel的加密包。

答案 2 :(得分:-1)

我是如何在Windows 7中解决的:

  1. 打开C:/Users/User/.ssh/known_hosts(或系统的设置方式)
  2. 找到行:192.168.1.215 sh-rsa AAAAB3NzaC1yc2EAAAADAQABAAA ....
  3. 删除整个部分(确保不要删除其他存储的主机)
  4. 尝试再次与MySQL Workbench连接
  5. 我希望这会有所帮助:)因为我花了好几个小时试图挖掘它。

答案 3 :(得分:-1)

我通过在ubuntu 16.04中降级python-crypto包解决了这个问题。 使用以下命令回滚版本2.6.1-6ubuntu0.16.04.2到2.6.1-6build1。

public class MyRecyclerViewAdapter extends RecyclerView.Adapter<MyRecyclerViewAdapter.DataObjectHolder> {

private ArrayList<String> mPdfPathsList;
private ArrayList<ArrayList<Integer>> mDimensionsList;
private Activity mActivity;


public class DataObjectHolder extends RecyclerView.ViewHolder {

    PDFView pdfView;

    public DataObjectHolder(View itemView) {
        super(itemView);
        pdfView = (PDFView) itemView.findViewById(R.id.pdfView);
    }
}

public MyRecyclerViewAdapter(ArrayList<String> pdfPathList, Activity activity, ArrayList<ArrayList<Integer>> dimensionList) {
    mActivity = activity;
    mPdfPathsList = pdfPathList;
    mDimensionsList = dimensionList;

}

@Override
public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_view_item, parent, false);
    return new DataObjectHolder(view);
}

@Override
public void onBindViewHolder(DataObjectHolder holder, int position) {
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(mDimensionsList.get(position).get(0), mDimensionsList.get(position).get(1));
    holder.pdfView.setLayoutParams(params);
}

@Override
public int getItemCount() {
    return mPdfPathsList.size();
}

@Override
public void onViewAttachedToWindow(DataObjectHolder holder) {
    super.onViewAttachedToWindow(holder);

    holder.pdfView.useBestQuality(false);
    holder.pdfView.fromAsset(mPdfPathsList.get(holder.getAdapterPosition()))
            .enableDoubletap(true)
            .pages(0)
            .load();
}}