mac在配置mysql的时候遇到如下错误

来源:2-2 mysql和navicat的安装和使用

Giroy3925940

2017-07-07

AbbottdeMacBook-Pro:~ Abbott$ mysql -u root -p

Enter password: 

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

输入的密码是root


写回答

1回答

四月_

2017-07-08

用grant命令,把密码设置为root,然后在重启mysql登录

grant all privileges on *.* to 'root'@'localhost' identified by 'root' with grant option

0
1
Giroy3925940
非常感谢!
2017-07-08
共1条回复

Scrapy打造搜索引擎 畅销4年的Python分布式爬虫课

带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎

5831 学习 · 6293 问题

查看课程