0

For some time I was successfully using MySQL on my Mac (OS X 10.9) installed from the DMG. However, one day it has crashed and I could not restart the server again. I tried to reinstall it several times, both with DMG and homebrew, but nothing worked.

If I just simply run it, I get:

$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Whenever I try to start the server, I get

$ mysql.server start  
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/myhost.pid).

Combined instruction from https://stackoverflow.com/a/5140849/4189299 and https://stackoverflow.com/a/34840101 do not work.

That means, nothing changes after I run

unset TMPDIR
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

If I try to start the safe mode, it terminates immediately:

$ sudo mysqld_safe start  
2016-04-07T13:31:41.6NZ mysqld_safe Logging to '/usr/local/var/mysql/myhost.err'.
2016-04-07T13:31:41.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2016-04-07T13:31:42.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/myhost.pid ended

Please, help me to start MySQL

EDIT:

$ ls /var/log/mysql*
ls: /var/log/mysql*: No such file or directory

EDIT 2:

The PID file actually does not exist:

$ rm /usr/local/var/mysql/myhost.pid
rm: /usr/local/var/mysql/myhost.pid: No such file or directory
Community
  • 1
  • 1
Roman
  • 2,225
  • 5
  • 26
  • 55
  • Something in `/var/log/mysql*`? – Daniel W. Apr 07 '16 at 13:39
  • @DanFromGermany No – Roman Apr 07 '16 at 13:44
  • Possible duplicate of [MySql server startup error 'The server quit without updating PID file '](http://stackoverflow.com/questions/4963171/mysql-server-startup-error-the-server-quit-without-updating-pid-file) – symcbean Apr 07 '16 at 13:58
  • (try deleting the PID file) – symcbean Apr 07 '16 at 13:59
  • @symcbean It is not a duplicate: solution from the answer to this post did not work for me – Roman Apr 07 '16 at 14:13
  • @symcbean this file does not exist initially – Roman Apr 07 '16 at 14:16
  • Which solution? None of the replies there have been flagged as solving the problem in that case and you have not tried all the suggestions. – symcbean Apr 07 '16 at 14:18
  • @symcbean I mean http://stackoverflow.com/a/11061487/4189299 as the most voted answer. Other answers (reinstall, delete log file, delete *.err file, kill still running MySQL) do not work or are not applicable (because the files do not exist and MySQL is not running) – Roman Apr 07 '16 at 14:51
  • See my problem and solution here; http://dba.stackexchange.com/questions/129480/mysql-launch-fails-after-upgrade-to-5-7-11?noredirect=1#comment241931_129480 and I also recommend trying to launch from mysqlworkbench. – john elemans Apr 07 '16 at 16:40
  • @john elemans I was actually connecting from mysqlworkbench initially until the connection crashed and could not be reestablished again. I think, in order to connect from mysqlworkbench or wherever, the MySQL server must be launched in the first place, and I cannot figure out, how to do that. – Roman Apr 08 '16 at 06:34
  • No, that is not correct. There is a place to start the server in the workbench. – john elemans Apr 08 '16 at 15:32
  • @john elemans Can you explain in more detail, how to start the server from the Workbench? – Roman Apr 11 '16 at 10:47

1 Answers1

0

Launch MySQLWorkbench. On my version, 6.3, there is a + button to create a connection. Click that. Set the host name to 127.0.0.1 and set the username to root, give the connection any name you like.

Click, OK. Now the connection with the name you have given it will appear on the front window. Double click it to open it.

On the left side of the window there is a column of options. Under Instance look for "Startup / Shutdown". Click that and look for the "Start Server" button. Click on that to start.

john elemans
  • 2,578
  • 2
  • 15
  • 26
  • When I double click on the connection, the error message "Cannot Connect to Database Server" pops up, so I have no possibility to proceed further to actually see the "Startup / Shutdown" button. – Roman Apr 12 '16 at 09:01