3

I want to connect a remote MySql database from MySql workbench but I got an error:

"IO Error: [Errno None] Unable to connect to port 22 on or xx.xx.xx.xx"

What should I do?

  1. I already add my IP to remote host
  2. when I delete IP that makes the error, then I'm trying to connect, that IP showed up again in my remote host

So how can I connect to my database from MySQLWorkbench?

1
  • 1
    Port 22 is genrally only for SSH. If you're trying to connect to MYSQL over SSH, that might be a firewall issue. If you're trying to connect directly, that's the wrong port. MySQL is on 3306 by default, but, do not leave your MySQL server exposed to the public internet. Commented Jun 2, 2018 at 2:40

1 Answer 1

1

How to Connect to a Database with MySQL Workbench

One tool you can use to connect to remotely connect to databases on your shared, VPS, or Dedicated hosting account is MySQL Workbench. MySQL Workbench is a free tool you can use to connect to your server databases from your personal computer. MySQL Workbench can be Downloaded for free at the following link:

http://dev.mysql.com/downloads/workbench/ You will want to use the Windows (x86, 32-bit), MSI Installer if you are on Windows. The file we are installing in this tutorial is the mysql-workbench-gpl-5.2.47-win32.msi file.

Once you have downloaded MySQL Workbench, you can install it onto your computer. After you have the program installed, follow the steps below to set up a remote connection.

Add IP to your Remote MySQL

In order for you to be able to connect to your databases remotely you will need to add your local computer IP address to the Remote MySQL in cPanel.

Steps to connect to your database remotely

  1. Open MySQL Workbench.
  2. Click New Connection towards the bottom left of MySQL Workbench.
  3. In the "Set up a New Connection Dialogue" box, Type your Database connection credentials.

    The credentials will be like the following:

    Connection Name: You can name this whatever you like.

    Connection Method: Standard (TCP/IP).

    Hostname: You can use your domain our your cPanel IP address.

    Port: 3306

    Username: Your cPanel username or the user you created for the database.

    Password: cPanel password or the password for the database user that was created.

    Default Schema: This can be left blank.

    Click Test Connection.

  4. Type your password and click the "Save Password in Vault" check box. Click Ok.

  5. MySQL Workbench should say "Connection parameters are correct". Click Ok.
  6. Click Ok again to accept the connection settings.
  7. Now under the SQL Development section you will see your connection listed in the Open Connection to Start Querying box. Click your newly created account.

Now you will see the databases list in the area on the left.

Sign up to request clarification or add additional context in comments.

1 Comment

Very vague answer. What Hostname to put in? You sai d your Cpanel IP address which I tried and it doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.