gpt4 book ai didi

mysql - MySQL自动生成临时密码后无法访问

转载 作者:IT老高 更新时间:2023-10-28 12:53:43 25 4
gpt4 key购买 nike

我已经删除并安装了 OSX 10.11 El Capitan 并且我一直在关注 this tutorial在新的 OS X 上启动并运行 MySQL。第一步是下载 MySQL For Mac OS X 10.9 (x86, 64-bit), DMG Archive (适用于 10.11,他们在教程中推荐)。当我完成安装 MySQL 时,我收到一条消息:

2015-10-25T02:10:54.549219Z 1 [Note] A temporary password is generated for root@localhost: R>gFySuiu23U

If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.

这很奇怪,我从未见过这种消息。之后,我通过 Preference Pane 启动 MySQL,然后在终端上使用 /usr/local/mysql/bin/mysql -v 命令进行下一步。我收到一条错误消息:

ERROR 1045 (28000): Access denied for user 'cheetah'@'localhost' (使用密码: NO)

我也尝试通过 Sequel Pro 使用 root 作为用户名和空白密码访问数据库,我收到拒绝访问的消息说:

Unable to connect to host 127.0.0.1 because access was denied.

Double-check your username and password and ensure that access from your current location is permitted.

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

好的,我也再次尝试使用 root 作为用户名,但使用“R>gFySuiu23U”作为密码(从 MySQL 生成)。我收到连接失败消息:

Unable to connect to host 127.0.0.1, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Your password has expired. To log in you must change it using a client that supports expired passwords.

我该如何解决这个问题?我记得 MySQL 从来没有自动生成过这样的临时密码,不是吗?

最佳答案

试试这个:

mysql -u root -h 127.0.0.1 -p
Enter password: (enter the random password here)

引用:https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html

之后,您可以使用以下方式重置密码ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';

关于mysql - MySQL自动生成临时密码后无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33326065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com