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        56 Jan 25 15:50 auto.cnf
-rw-rw----    1 _mysql  admin       667 Jan 25 15:50 binlog.000001
-rw-rw----    1 _mysql  admin       528 Jan 27 22:54 binlog.000002
-rw-r-----    1 _mysql  admin       156 Jan 27 22:34 binlog.000003
-rw-r-----    1 _mysql  admin        48 Jan 27 22:34 binlog.index
-rw-rw----    1 _mysql  admin      1676 Jan 25 15:50 ca-key.pem
-rw-rw----    1 _mysql  admin      1112 Jan 25 15:50 ca.pem
-rw-rw----    1 _mysql  admin      1112 Jan 25 15:50 client-cert.pem
-rw-rw----    1 _mysql  admin      1676 Jan 25 15:50 client-key.pem
-rw-r-----    1 _mysql  admin      3372 Jan 27 22:54 ib_buffer_pool
-rw-rw----    1 _mysql  admin  50331648 Jan 27 23:20 ib_logfile0
-rw-rw----    1 _mysql  admin  50331648 Jan 25 15:50 ib_logfile1
-rw-rw----    1 _mysql  admin  12582912 Jan 27 22:35 ibdata1
-rw-r-----    1 _mysql  admin  12582912 Jan 27 22:35 ibtmp1
drwxrwx---    8 _mysql  admin       256 Jan 25 15:50 mysql
-rw-rw----    1 _mysql  admin  25165824 Jan 27 22:35 mysql.ibd
-rw-rw----    1 _mysql  admin      2481 Jan 27 22:34 mysqld.local.err
-rw-r-----    1 _mysql  admin         4 Jan 27 22:34 mysqld.local.pid
drwxrwx---  111 _mysql  admin      3552 Jan 25 15:50 performance_schema
-rw-rw----    1 _mysql  admin      1680 Jan 25 15:50 private_key.pem
-rw-rw----    1 _mysql  admin       452 Jan 25 15:50 public_key.pem
-rw-rw----    1 _mysql  admin      1112 Jan 25 15:50 server-cert.pem
-rw-rw----    1 _mysql  admin      1676 Jan 25 15:50 server-key.pem
drwxrwx---    3 _mysql  admin        96 Jan 25 15:50 sys
-rw-rw----    1 _mysql  admin  16777216 Jan 27 23:20 undo_001
-rw-rw----    1 _mysql  admin  16777216 Jan 25 15:50 undo_002

How do I fix this?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top