当我尝试运行brew services start mysql时,我收到错误:
Bootstrap failed: 5: Input/output error
有人告诉我,我的 Mac 上的 mysql 可能已更新(我使用的是 mysql 9.0.1、Sonoma 14.6.1、M1 MacBook Pro),数据库需要升级。但我不知道该怎么做。
在 mysql 更新后我需要运行一个命令来升级我的数据库吗?
我尝试停止、启动和重新启动 mysql。我还尝试删除符号链接并重新链接。
运行
brew info mysql
,在警告部分,有详细的迁移说明。
❯ brew info mysql
...
==> Caveats
Upgrading from MySQL <8.4 to MySQL >9.0 requires running MySQL 8.4 first:
- brew services stop mysql
- brew install [email protected]
- brew services start [email protected]
- brew services stop [email protected]
- brew services start mysql
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
To start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql/bin/mysqld_safe --datadir\=/usr/local/var/mysql
此次迁移后,如果mysql仍然无法启动,请检查
*.err
文件夹中的$(brew --prefix)/var/mysql
日志文件。