TablePlus / DBngin

DB Engine
https://dbngin.com
1.08k stars 19 forks source link

Can’t connect to MySQL server on 127.0.0.1 (61) #100

Open a-am opened 1 year ago

a-am commented 1 year ago

Please fill out the detail below, it helps me investigate the bug:

  1. Driver (Ex: PostgreSQL 10.0): MySQL 8.0.27 port 3307 or 3306 ( tried both)

  2. DBngin build number: 6.4

  3. macOS version: Ventura 13.2.1

  4. The steps to reproduce this issue: Start Up MySQL, then open try to open database in TablePlus or SEQUEL Ace

After updating Homebrew and fixing some permissions for brew cleanup files, I try to access this database and get this error: "Can’t connect to MySQL server on 127.0.0.1 (61)".

I have tried just creating a new MySQL 8.0.27 database and opening in TablePlus and that works. Is there a way to recover the database files from the other DB that keeps throwing that error?

emmab30 commented 1 year ago

I got able to make it work by doing the following:

Create a my.cnf file wherever you want with the following content:

[mysqld]
sql_mode = "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
default_authentication_plugin = mysql_native_password
port = 3306

Then go to DBngin and set that configuration file in the connection settings. Once I did this, it got fixed but then I got another error regarding the authentication driver once connected. What I needed to do is the following:

Go to the terminal and then type the following:

mysql --socket=/tmp/mysql_3306.sock -u root

Once you're connected, you need to execute the following commands:

ALTER USER 'root'@'localhost' IDENTIFIED BY '';
FLUSH PRIVILEGES;

Then try connecting again using the above command and it should work.

Hope this is helpful for anyone suffering this error.

sineld commented 1 year ago

https://github.com/TablePlus/DBngin/issues/102#issuecomment-1666075720