I'm having a problem that appears to be fairly commonplace, though having read around and attempted numerous solutions I'm quite confused as to what's going on here. The crux of the problem is, ever time I restart my Mac (running on OS X Yosemite 10.10.3
) after installing MySQL it cannot connect, start or function, with the following message displayed ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
.
I have installed MySQL using brew, where it resides in /usr/local/Cellar/mysql/5.6.26/
. When I run mysqld_safe from here it quits each time, failing to start. I've looked at the error file and these are the error messages:
2015-09-16 10:43:27 7fff77882300 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Could not find a valid tablespace file for 'bespokedb/concept_terms'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Tablespace open failed for '"bespokedb"."concept_terms"', ignored.
2015-09-16 10:43:27 7fff77882300 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Could not find a valid tablespace file for 'bespokedb/terms'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Tablespace open failed for '"bespokedb"."terms"', ignored.
2015-09-16 10:43:27 1421 [Note] InnoDB: 128 rollback segment(s) are active.
2015-09-16 10:43:27 1421 [Note] InnoDB: Waiting for purge to start
2015-09-16 10:43:27 1421 [Note] InnoDB: 5.6.26 started; log sequence number 12730080990
Warning: World-writable config file './auto.cnf' is ignored /usr/local/Cellar/mysql/5.6.26/bin/mysqld: Error on delete of './auto.cnf' (Errcode: 13 - Permission denied)
2015-09-16 10:43:27 1421 [Warning] World-writable config file './auto.cnf' has been removed.
Warning: World-writable config file './auto.cnf' is ignored
2015-09-16 10:43:27 1421 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 617f6dd0-5c57-11e5-a7aa-9c9a2e17ea50.
I have tried making the mysql data dir (which is in /usr/local/var/mysql
) folders and files read, write and executable (a bit naughty I know). I've also tried creating a sim link for the mysql.sock in /var/mysql/
. Aside from that I've uninstalled and reinstalled mysql numerous times and have followed many routines detailed online on how to remove/add startup items. All in all, this seems very overcomplicated for a very widely used piece of kit on a very widely used operating system. If somebody would be very kind to go into some detail here about how these problems might be arising / why this process isn't more simple that would be brilliant. I only want to learn!
Thanks,
Dan