HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Server quit without updating PID file when trying to start MySQL server?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
withoutfilequitupdatingtryingstartpidmysqlwhenserver

Problem

So I created my .bash_profile, opened it in a text editor and added:

export PATH=$PATH:/usr/local/mysql/bin


and then I saved it. Next, I tried running

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


was told to enter my password (so I did), and then terminal said

Starting MySQL


and then it kept printing dots until it said:

ERROR! The server quit without updating PID file (/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid).


The error logs look like:

2021-01-25T20:50:49.707062Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.23) starting as process 15092
2021-01-25T20:50:49.710232Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2021-01-25T20:50:49.834599Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-25T20:50:49.943719Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-01-25T20:50:50.037810Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2021-01-25T20:50:50.125494Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-01-25T20:50:50.126128Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-01-25T20:50:50.151069Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.0.23'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server - GPL.
~
~
~
~
~
(END)


The output of ls -l /usr/local/mysql/data is:

```
total 377992
-rw-rw---- 1 _mysql admin 196608 Jan 27 23:20 #ib_16384_0.dblwr
-rw-rw---- 1 _mysql admin 8585216 Jan 25 15:50 #ib_16384_1.dblwr
drwxrwx--- 12 _mysql admin 384 Jan 27 22:34 #innodb_temp
-rw-rw---- 1 _mysql admin 112320 Jan 28 19:07 Nicks-MacBook-Pro.local.err
-rw-rw---- 1 _mysql admin

Solution

I think the problem might be the PID file

There are two I can see

One in the directory

/usr/local/mysql/data/mysqld.local.pid


and one in the error message

/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid


Please delete those two pid files if they still exist.

Then, start mysql and let’s us know what happens.

I have suggested this twice in the past, 4 years ago and 6 years ago

Before doing so, check to make mysqld is not running.

ps -ef | grep -v grep | grep mysqld


If you see mysqld still running, kill the process, then delete the pid files and retry starting mysql.
UPDATE 2021-01-29 15:56 EST

As it turns out, there were two installations of MySQL involved on the Mac as was learned in the Chat Session.

One installation was done as a dmg install; the other was a homebrew installation.

Once it was discovered that homebrew was competing with the dmg for the PID file, it was decided to stop using the dmg version and use the homebrew version via brew services approach.

The two installs were butting heads, having different PID files.

Code Snippets

/usr/local/mysql/data/mysqld.local.pid
/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid
ps -ef | grep -v grep | grep mysqld

Context

StackExchange Database Administrators Q#284048, answer score: 3

Revisions (0)

No revisions yet.