Mysql 登录,修改密码问题?

2016-01-01 17:47:52 +08:00
 yijiecaoming
官网下载的 mysql-5.7.10-osx10.10-x86_64.dmg 文件,安装好之后。
在.zshrc 中配置了环境变量。
输入这个命令
`➜ /Users/gang >mysql -u root -p password 123456`
>mysql Ver 14.14 Distrib 5.7.10, for osx10.9 (x86_64) using EditLine wrapper
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

>Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

>Usage: mysql [OPTIONS] [database]
...

输入
`mysql -u root -p password 123`
也能也出来
>mysql Ver 14.14 Distrib 5.7.10, for osx10.9 (x86_64) using EditLine wrapper
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

执行
`mysqladmin -u root -p`
>也是同样的

修改密码
`mysqladmin -u root -p password 123456`
>Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

刚安装的,不默认没有密码么?
baidu,google 都解决不了。
求解决,感谢🙏
2561 次点击
所在节点    MySQL
2 条回复
cassia
2016-01-01 19:48:22 +08:00
按照步骤一步一步来喽,今天新机刚做开发环境,和 mariadb 差不多,给你参考下 https://goo.gl/PX8bhc
julyclyde
2016-01-05 13:34:24 +08:00
你所谓的“能出来”是指能出来 mysql 的提示符还是 usage 啊?
我觉得你都没启动 mysql 后台服务

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/247684

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX