• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

详解mac使用homebrew安装MySQL无法登陆问题的解决办法

mysql 搞代码 4年前 (2022-01-09) 18次浏览 已收录 0个评论

如果你电脑是Mac的,使用homebrew安装MySQL是一个非常便捷的方式,但是还是会出现一些问题。下面通过本文给大家介绍解决mac使用homebrew安装MySQL无法登陆问题,需要的朋友可以参考下

如果你电脑是Mac的,使用homebrew安装MySQL是一个非常便捷的方式,但是还是会出现一些问题;

首先保证你已经安装了mysql,如果是通过homebrew安装的,输入mysql.server start 启动服务

如果在输入

mysql -u root

出现这个错误ERROR 1045 (28000): Access denied for user 'zhongchengming'@'localhost' (using password: YES),应该是修改初始密码没有成功

解决步骤

(1)终端输入mysqld_safe –skip-grant-tables 显示如下

2017-03-21T11:44:11.6NZ mysqld_safe Logging to '/usr/local/var/mysql/zhongchengmingdeMacBook-Air.local.err'.2017-03-21T11:44:11.6NZ mysqld_safe Logging to '/usr/local/var/mysql/zhongchengmingdeMacBook-Air.local.err'.2017-03-21T11:44:11.6NZ mysqld_safe A mysqld process already exists

(2)再次输入mysql -u root显示如下

Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id<i style="color:transparent">本文来源gaodai$ma#com搞$$代**码)网8</i> is 10Server version: 5.7.17 HomebrewCopyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

(3)终端输入 use mysql显示如下

Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql>

(4)修改密码UPDATE mysql.user SET authentication_string=PASSWORD('你的密码') WHERE User='root';

成功 Query OK, 1 row affected, 1 warning (0.05 sec)

Rows matched: 1 Changed: 1 Warnings: 1

以上就是详解mac使用homebrew安装MySQL无法登陆问题的解决办法的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:详解mac使用homebrew安装MySQL无法登陆问题的解决办法

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址