mysql 找不到user文件,找不到“ ./mysql/user.MYD”(错误代码:13-权限被拒绝)

I am trying to do a fresh install of Mac OSX LAMP and running the command

mysql_secure_installation

I have inputting the root password and I have to now input a new password when I'm hit with this error, has anyone got any experience with this?

Re-enter new password:

... Failed! Error: File './mysql/user.MYD' not found (Errcode: 13 - Permission denied)

解决方案

Please retry to completely remove mysql by executing:

brew remove mysql

brew cleanup

sudo rm /usr/local/mysql

sudo rm -rf /usr/local/var/mysql

sudo rm -rf /usr/local/mysql*

sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

sudo rm -rf /Library/StartupItems/MySQLCOM

sudo rm -rf /Library/PreferencePanes/My*

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

rm -rf ~/Library/PreferencePanes/My*

sudo rm -rf /Library/Receipts/mysql*

sudo rm -rf /Library/Receipts/MySQL*

sudo rm -rf /private/var/db/receipts/*mysql*

And then restart your computer to make sure that all the processes have been killed.

Then execute these commands to install MySQL:

brew update

brew install mysql

unset TMPDIR

mysql_install_db --verbose --user='' --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

mysql.server start

This should do the trick.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值