3

I have problem mysql starting, i was update to El captian on mac.

In terminal,

brew install mysql

mysql.server start

but it not working this is error message.

 Starting MySQL... ERROR! The server quit without updating PID file(/usr/local/var/mysql/Heo-MacBook-Pro.local.pid).

help me please!

Community
  • 1
  • 1
Yunhee
  • 125
  • 1
  • 4
  • 11

4 Answers4

8

I had the same problem using brew command to start mysql service. If you are using MacOS, go to System Preferences and click on MySQL icon. Probably you'll see information message about permission denied in some directories. All you need to do is to give permission to that.

That's worked for me.

  1. Open your terminal
  2. Execute this command: sudo chown -R mysql /usr/local/mysql/data
Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
Braian
  • 185
  • 1
  • 2
  • 8
7

Try this first:

/usr/local/var/mysql/support-files/mysql.server restart

If that doesn’t fix Remove or backup the /etc/my.cnf


also try this method:

sudo /usr/local/var/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! ....................

remove the .err files like so:

rm *.err /usr/local/var/mysql/data/
HashSu
  • 1,507
  • 1
  • 13
  • 13
4

Solution working for my case:

  1. Check your error log at /usr/local/var/mysql/Heo-MacBook-Pro.local.err

  2. If there is something like this in the log: ...[Note] Unable to delete pid file: Permission denied..., which means mysql does not have the permission to your mysql folder

  3. Use the following command in terminal to grant the permission: sudo chown -R mysql /usr/local/var/mysql/

Shi Jieming
  • 541
  • 6
  • 5
  • 2
    `sudo chown -R mysql /usr/local/var/mysql/` helped me after updating to High Sierra –  Oct 28 '17 at 16:29
0

The Problem could also be a version mismatch. My db was installed with Homebrew as version 5, later unintentionally upgraded to version 8.

Check the most recent error log at /usr/local/var/mysql/<your-computers-name.some.domain>.err You can conveniently read the last couple of lines (e.g. 40) of the file with tail -n 40 <your-computers-name.some.domain>.err

You may find a hint about upgrading istructions in this case.

stewo
  • 443
  • 4
  • 11