1

I am trying to connect from a Raspbian shell to a remote MySQL database (Windows).

I freshly installed mysql-client and mysql-server (version 5.5.55) and now try following command:

mysql -v -h hostname -uroot -pmypass db_name

I get no response at all. Program does not exit or print anything just keeps hanging.

Connecting to a local DB works fine with mysql -uroot -pmypass.

I am quite confused why the client does not print anything even with the verbose option being set on.

Thanks!

3
  • 2
    Check your my.cnf. make sure bind-address variable is comment and make sure 3306 port is open.
    – HamoonDBA
    Commented Jul 1, 2017 at 11:34
  • Commenting bind-address property helped, I started getting responses from the client. Thank you!
    – Andrej
    Commented Jul 1, 2017 at 12:26
  • OK I'm posting my comment to help another people.
    – HamoonDBA
    Commented Jul 1, 2017 at 12:44

2 Answers 2

2

Check your my.cnf settings. Make sure the bind-address variable is commented or its value is 0.0.0.0

Make sure port 3306 (MySQL Default Port) is open (Both on the server and on the client).

0

I had the same issue and most of the solutions given are:

  1. Change config file to allow port/address
  2. Allow program/port through firewall
  3. Check the IP/URL for the remote connection

But in my case, the database was hosted on a remote server and the router required port forwarding.

  1. Go to your router settings (Open browser and type in 192.168.0.1 or similar)
  2. Enter credentials (mostly admin/admin or admin/password)
  3. Find "forwarding" or "port forwarding" in menu
  4. Create new entry (In my case I used postgres so 5432 port with TCP)

Hope it helps.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.