1

I have a project running on Docker and I'm able to connect to the database through the terminal:

mysql -h localhost -P 33060 --protocol=tcp -u 'notmyrealusername' -p 

This works fine and I'm able to show the tables from the database.

However, when trying to connect via SequelPro, I get the following error:

Unable to connect to host 127.0.0.1, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Protocol mismatch; server version = 11, client version = 10

Note that the project is running on MySQL 5.7.34 and the version on my computer is 8.0.23.

OS: Mac OS Catalina

What I have tried:

From this thread, I have tried also with the port of 2200 and, well, SequelPro won't let me use 127.0.0.1. So, I couldn't try the second one.

I have also granted all privileges to both 'notmyrealusername'@'127.0.0.1' and 'notmyrealusername'@'localhost', but that didn't seem to fix it either.

Replying to Philippe's questions:

  • Yes, If I try mysql -h 127.0.0.1, then I get the same error:

ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10

Question: Does anyone know either how to connect to 'localhost' and not '127.0.0.1' on SequelPro or why I can't seem to connect to this database on SequelPro, when, with the same data, I can easily connect via terminal?

Thanks in advance for all of the help/suggestions you can provide!

Thanks!

Brad Ahrens
  • 4,864
  • 5
  • 36
  • 47
  • Have you tried `mysql -h 127.0.0.1`, or configure Sequel Pro to use localhost ? – Philippe Jul 10 '21 at 18:16
  • Thanks for your reply @Philippe. I have tried `mysql -h 127.0.0.1`, but I get the same error `ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10` How do you configure Sequel Pro to use localhost? If I try, it pushes me to use either a socket connection or 127.0.0.1 – Brad Ahrens Jul 10 '21 at 18:20

1 Answers1

1

I have finally found the solution. For anyone wondering, the key here is that I am using Docker. In this case, as outlined in this forum post, we need to:

Use the IP address of the machine where the database is running (the real one, not localhost) as host address.

How?

  • Go to your terminal and use the command ifconfig . You'll get a bunch of data, but what you're looking for is the local network IP address. This usually looks like either 192.x.x.x or 10.x.x.x.

  • Then, in Sequel Pro or whatever GUI you are using, use this address (192....) instead of localhost.

I hope this helps someone and saves you time :)

Happy coding!

Brad Ahrens
  • 4,864
  • 5
  • 36
  • 47