0

My problem: After reboot my Mac, I can not connect to mysql either with WorkBench or the terminal.

  • When I try witch the terminal, sometimes it shows me correctly my bases / tables, sometimes it makes me a mistake.
  • When I open workbench and connect with root, I get an error message: not connected

    Connection:
    Name: root
    Host: localhost
    Port: 3306
    NO CONNECTION
    

But sometime, i can see my tables with this: enter image description here And if i close and open again, i have error without connection... depend.

Here are all the steps I did:

1) I completely uninstall Mysql by following these steps: https://gist.github.com/vitorbritto/0555879fe4414d18569d

2) I installed mysql 8 with brew brew install mysql

3) I have a file /Users/eoras/.my.cnf

[Mysqld]
bind-address = 127.0.0.1
default_authentication_plugin = mysql_native_password
  • ln -s /usr/local/etc/my.cnf / etc / my.cnf
  • ln -s /usr/local/etc/my.cnf ~ / .my.cnf

When i do this, all work fine, i can connect mysql and workbench and i have never errors...

BUT: if now, i restart my computer, mysql donc work anymore... i can't do nothing. I juste have to re-do this all steps.

I already search how to fix this, isn't permission issu, i don't realy know why.

Someone have the same issu ?

Eöras
  • 105
  • 2
  • 10
  • maybe mysql is not started after reboot? Did you try to check mysql status with "brew services list"?? – Sakura Kinomoto Jan 25 '19 at 17:09
  • Yes already did this, and i tried to restart too but same problem. As if the socket was damaged or there were 2 launched at the same time. It's incomprehensible. – Eöras Jan 26 '19 at 21:20
  • But, then, can you find a mysqld daemon on a ps? It's started? And if it is, there's something on the log? – Sakura Kinomoto Jan 26 '19 at 23:24
  • Yes he's started. Witch log are you speaking ? – Eöras Jan 28 '19 at 09:21
  • MySQL have a log file. On my case you can see at this: BloudFire:~ maqui$ "mysqladmin variables | grep log_e" <- run this command | log_error | /usr/local/var/mysql/BloudFire.local.err. Find your log and check it for errors. – Sakura Kinomoto Jan 28 '19 at 13:04
  • When i do `ps ax | grep mysql` i have: ```27803 ?? S 0:00.31 mysqld 84426 ?? S 0:00.03 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql 84579 ?? S 3:48.86 /usr/local/opt/mysql/bin/mysqld --basedir=/usr/local/opt/mysql --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/opt/mysql/lib/plugin --log-error=MacBook-Pro-de-Paul.local.err --pid-file=MacBook-Pro-de-Paul.local.pid 29167 s000 S+ 0:00.00 grep mysql ``` – Eöras Feb 01 '19 at 07:08
  • For now, i can use mysql with Workbench but not on termina. When i try with `mysql -u root -p` i have error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) and when i use `mysqladmin variables | grep log_e` i have same error – Eöras Feb 01 '19 at 07:09
  • I did `brew services stop mysql` and after `brew services start mysql` and i have access with both now. But if i restart my computer now, this will not work anymore... – Eöras Feb 01 '19 at 07:12
  • You cannot connect with socket, because probably you haven't started the socket. But, if workbench is working, probably you can connect with -h 127.0.0.1 – Sakura Kinomoto Feb 01 '19 at 11:03
  • I see this strange behaviour too.. I can see that every second or so the mysql.sock file in /tmp disappears and reappears Also using ps -A | grep mysql I can see one two processes, where one of them is constantly changing pid, thus probably dying and then restarting.. Which fits pretty good with the fact connecting to the database is very intermittent.. So not a solution I know, but I hope my observations can help figuring out whats going on – Steffen Otto Jensen Apr 16 '19 at 21:17

0 Answers0