Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOS Can't start MySQL Server

Tags:

mysql

macos

I have MacOS Sierra. I have installed MySQL Server which has been working, however, after a reboot of the Mac Book, I cannot start the MySQL Server.

enter image description here

I have tried changing the port from 3306 to 3307 in the my.cnf file.

Question

I would appreciate any help on how to start the MySQL Server, and also have it so it starts automatically on MacOS Boot up.

(I am new to Mac, so apologies if this is a basic question).

UPDATE

Looking for error logs, I can't find anything with todays (2/2/2017) timestamp.

enter image description here

Nothing in the data dir:

enter image description here

No files with "mysql" have been modified since I've tried to start the MySQL Server (2/2/2017 after 09:00).

enter image description here enter image description here

like image 360
Richard Avatar asked Feb 02 '17 06:02

Richard


People also ask

Why is MySQL not opening on Mac?

The reason behind the MySQL Workbench client not working can be many. It can be because your macOS version is not compatible with the version of the Workbench that you downloaded, or maybe because the version of Python installed on your macOS is not compatible with the version of Workbench you have downloaded.

How do I start MySQL server on Mac?

Open macOS system preferences and select the MySQL preference panel, and then execute Start MySQL Server. The Instances page includes an option to start or stop MySQL, and Initialize Database recreates the data/ directory.

Why does MySQL server not start?

Even with correct ownership, MySQL might fail to start up if there is other security software running on your system that manages application access to various parts of the file system. In this case, reconfigure that software to enable mysqld to access the directories it uses during normal operation.


Video Answer


2 Answers

I suggest using Terminal commands.

Start MySQL

sudo /usr/local/mysql/support-files/mysql.server start

Stop MySQL

sudo /usr/local/mysql/support-files/mysql.server stop

Restart MySQL

sudo /usr/local/mysql/support-files/mysql.server restart
like image 80
Ares Avatar answered Oct 06 '22 21:10

Ares


In my case, I had inadvertently transferred ownership of entire /usr/local directory to myself, which resulted in snatching-away of write permission of /usr/local/mysql-5.7.20-macos10.12-x86_64/data directory from the daemon user called "_mysql".

Restoring the ownership fixed the issue.

like image 29
y2k-shubham Avatar answered Oct 06 '22 21:10

y2k-shubham