MySQL访问拒绝root用户
x86_64上的linux(((ubuntu))上安装了MySQL *VER 8.0.28-0ubuntu0.20.04.3((Ubuntu))
我最近在
错误1045(28000):访问用户'root'@'localhost'(使用 密码:否)
无论有没有Sudo,我都知道这在堆栈和其他论坛上都有答案,但是似乎没有帮助我,我尝试重新安装MySQL Server,但这也无济于密码,但这也失败了,需要帮助,谢谢
i have recently installed MySQL *Ver 8.0.28-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))*
after installation when i try to access my shell its showing
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)
both with or without sudo, i know this has answers on stack and other forums but none seems to help me, i have tried reinstalling MySQL server but that also didn't help, i tried skip grant option and then changing root password but that failed as well , need help in this , thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用一个停机时间重置密码。只需按照8个版本的以下步骤即可。
$ SystemCtl停止MySQL
$ mysqld_safe- -skip-grant-tables&
$ mysql -uroot
$ Alter用户'root'@'localhost'由“密码”标识;
$ SystemCtl停止MySQL
$ Systemctl重新启动MySQL
You can reset the password with one downtime. Just simply follow the below steps for 8 version.
$ systemctl stop mysql
$ mysqld_safe --skip-grant-tables &
$ mysql -uroot
$ alter user 'root'@'localhost' identified by 'password';
$ systemctl stop mysql
$ systemctl restart mysql