PID error when starting mysql.server?

I just tried installing MySQL using homebrew (on Mac OS X 10.6), but I ran into a problem on the first hurdle. When I try to manually start the server (starting mysql.server), I get the following error:

. ERROR! Manager of pid-file quit without updating file. 

Unfortunately, I'm not sure which error logs or configuration files are checked, as I have never installed MySQL this way before.

+28
mysql homebrew pid macos
Dec 14 '10 at 22:17
source share
7 answers

I ran into this problem when installing through homebrew. Make sure that you run these commands (which are listed during installation, but are easy to skip):

 unset TMPDIR mysql_install_db 
+30
Dec 24 '10 at 19:59
source share

you probably need to make sure that you are using mysql as the root , otherwise he will not have permission to write the PID file (this way you will get an error).

Try the following:

 sudo mysql.server start 

You will be prompted for a password. (this assumes that your user account has permissions to "sudo" - that it should, unless it is set as a limited user account in OS X).

This may not be the only problem, but in any case, it should lead you to the next step.

Good luck

+14
Dec 14 '10 at 22:22
source share

I encountered the same problem when trying to install MySQL 5.5.15 in Lion using homebrew and solved the problem:

 mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp 

and creating the file ~ / my.cnf

with content:

  [mysqld] basedir=/usr/local/Cellar/mysql/5.5.15 datadir=/usr/local/var/mysql 

basedir - should be your current MySQL installation location datadir - should be the location of MySQL data

You can determine this location by observing the make command during "brew install mysql", looking for something like this:

 -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.15 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql 

Where DCMAKE_INSTALL_PREFIX = basedir and DMYSQL_DATADIR = datadir

+6
Dec 10 2018-11-12T00:
source share

These two teams should solve your problem.

 > unset TMPDIR > mysql_install_db --verbose --user=\`whoami\` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp 
+6
Dec 09 '12 at 15:47
source share

I add this here because I encountered this problem several times after installing other software. MySQL worked fine for several days, and then suddenly I got this error.

This happens when I install something (like elasticsearch or the Puma web server). MySql permissions are returned again (back to me, not _mysql ). I do not know why.

  • Macos sierra
  • Homebrew 1.0.5-43-g41b2df8 (2016-10-02)
  • MySQL 5.7.15

So, I found that one of the reasons for this is permission to the location where MySQL stores your databases, which are by default here:

 /usr/local/var/mysql 

If you look in this folder, you will see a file

 <your computer name>.err 

If you look inside this file ( more it or cat it), you will probably see this error:

 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable 

If so, you know this is a permissions issue.

If you don't care, you can just start MySQL by simply starting mysqld (and leave this terminal open).

If you don't care:

ls -al /usr/local/var/mysql

You will notice that permissions are probably all set for you (your user account). This means that mysql cannot mount your databases at startup using the homebrew shortcut sudo mysql.server start [even if you use sudo to run in "admin" mode].

So change the permissions:

 $ sudo chown -R _mysql /usr/local/var/mysql $ sudo chmod -R o+rwx /usr/local/var/mysql 

Then it will work.

+3
Oct 02 '16 at 18:34
source share

For some reason I cannot comment below Immendes above, but in 10.8.2 with mySQL 5.6.10, in addition to checking db_install and adding my.cnf, I also had chown -R myusername / tmp / mysql.sock.

It seems that allowing mySQL to run as a user (as indicated in the root directory or www, as I do on Linux) is not a good idea in this regard (although Homebrew could update the formula - out of my scope and time).

+1
Mar 05 '13 at 18:34
source share

Nothing else helped, but the following worked:

 $ ps aux | grep mysql tagir 27260 0.0 1.0 3562356 175120 ?? S 2:52PM 0:00.42 mysqld --skip-grant-tables tagir 42704 0.0 0.0 2434840 784 s000 S+ 3:04PM 0:00.00 grep mysql $ kill 27260 # Careful! This might erase your existing data $ rm -rf /usr/local/var/mysql $ mysqld --initialize $ mysql.server start 
+1
Apr 04 '16 at 21:49
source share



All Articles