当我尝试使用 Homebrew(macOS Big Sur 11.4 和 MacBook Pro M1 芯片环境)保护我的 MariaDB 安装时遇到问题。
我使用该命令通过 Homebrew 安装了 MariaDB 并且没有出现错误:
brew install mariadb
然后在尝试执行推荐的安全过程时:
sudo /opt/homebrew/bin/mysql_secure_installation
我收到错误:
touch: .my.cnf.25188: Read-only file system
touch: .mysql.25188: Read-only file system
chmod: .my.cnf.25188: No such file or directory
chmod: .mysql.25188: No such file or directory
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
/opt/homebrew/bin/mysql_secure_installation: line 249: .my.cnf.25188: Read-only file system
/opt/homebrew/bin/mysql_secure_installation: line 250: .my.cnf.25188: Read-only file system
/opt/homebrew/bin/mysql_secure_installation: line 251: .my.cnf.25188: Read-only file system
/opt/homebrew/bin/mysql_secure_installation: line 253: .my.cnf.25188: Read-only file system
/opt/homebrew/bin/mysql_secure_installation: line 218: .mysql.25188: Read-only file system
/opt/homebrew/bin/mysql_secure_installation: line 220: .mysql.25188: No such file or directory
我在网上搜索了很多,但找不到任何解决方案。
有人遇到过并为此找到解决方案吗?
为什么你们保持试图sudo
用brew
。Homebrew 不支持 root 权限。不要sudo
在brew
.
# For x86 Mac
sudo chown -R $(whoami):admin /usr/local/*
# For M1 Mac
sudo chown -R $(whoami):admin /opt/homebrew/*
/opt/homebrew/opt/mariadb/bin/mysql_secure_installation
抱歉,我不想再解释为什么这里brew
不支持sudo
。任何有兴趣的人都可以查看这个答案。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句