I installed MySQL with Homebrew and I think it was version 5.7 or earlier version at the end of 2022.
mysql.server start
used to work fine until recent months.
My current mysql is of Ver 9.1.0 for macos14.7 on x86_64 (Homebrew)
.
I can still see the .ibd
files with my table names in /usr/local/var/mysql
.
But when I run mysql.server start
, there is this error:
Starting MySQL
..... ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Pro-2.local.pid).
And /usr/local/var/mysql/MacBook-Pro-2.local.err
shows:
2025-01-02T13:12:48.6NZ mysqld_safe Logging to '/usr/local/var/mysql/MacBook-Pro-2.local.err'.
2025-01-02T13:12:48.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2025-01-02T13:12:48.235894Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2025-01-02T13:12:48.416439Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/9.1.0/bin/mysqld (mysqld 9.1.0) starting as process 2590
2025-01-02T13:12:48.418974Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2025-01-02T13:12:48.427614Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-01-02T13:12:48.574683Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2025-01-02T13:12:48.574725Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2025-01-02T13:12:48.574738Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2025-01-02T13:12:48.574770Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2025-01-02T13:12:48.574779Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2025-01-02T13:12:48.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/MacBook-Pro-2.local.pid ended
Somehow I tried installing different versions of mysql in Homebrew and tried moving the data out of /usr/local/var/mysql
and run mysqld --initialize --user=$(whoami) --datadir=/usr/local/var/mysql
. But nothing really worked. I moved all the files back to /usr/local/var/mysql
.
How can I make mysql.server start
work again? At least, can I restore my data?
Asked by Paul Chuang
(101 rep)
Jan 3, 2025, 01:23 AM