1

I found some instructions online but running into an error:

Following this - Setting the MySQL root user password on OS X

I ran

sudo mysqld_safe --skip-grant-tables

The results were:

2017-06-28T15:22:12.6NZ mysqld_safe Logging to '/usr/local/var/mysql/Morgans-iMac.local.err'. 2017-06-28T15:22:12.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql

So it looks like it is running. However when I type in (in a new window):

mysql -u root

I get the error:

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

What am I doing wrong? Is this a pathing problem?

Kamil Gosciminski
  • 16,547
  • 8
  • 49
  • 72
Morgan Allen
  • 3,291
  • 8
  • 62
  • 86

2 Answers2

0

You have to create a symbolic link for the '/tmp/mysql.sock' as it is not present, it is available in a different location where mysql is installed.

It is similar to the following one mentioned in this post,

Database connection "Mysql" is missing and mysql.sock is missing

0

If symbolic link for the '/tmp/mysql.sock' doesn't help you then this is possible permission problem. Try: sudo chmod +t /tmp