MacOSX自制mysql root密码 [英] MacOSX homebrew mysql root password

查看:51
本文介绍了MacOSX自制mysql root密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,MySQL停止给予root用户访问权限.卸载并通过Homebrew重新安装.重新安装,重新安装桌子,但是当我输入

For some reason MySQL stopped giving access for root. Uninstalled and reinstalled with Homebrew. Fresh install, fresh tables but when I enter

mysql -u root -p

我收到此错误:

拒绝用户'root'@'localhost'的访问(使用密码:否)

Access denied for user 'root'@'localhost' (using password: NO)

我重新安装了MySQL五次,但仍然要求输入密码.我该如何解决?

I reinstalled MySQL five times but it is still asking for a password. How do I fix this?

推荐答案

只需运行以下命令(其中NEWPASS是您的密码):

Just run this command (where NEWPASS is your password):

$(brew --prefix mysql)/bin/mysqladmin -u root password NEWPASS

我遇到了相同的错误,并以此方式解决了该问题.

I have had the same error and fixed it this way.

这篇关于MacOSX自制mysql root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆