Mysql入门ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user root@ localhost问题的解决方法

Mysql入门ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user root@ localhost问题的解决方法,第1张

概述介绍《Mysql入门ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user root@ localhost问题的解决方法》开发教程,希望对您有用。

《MysqL入门ubuntu系统中MysqL ERROR 1045 (28000): Access denIEd for user root@ localhost问题的解决方法》要点:
本文介绍了MysqL入门ubuntu系统中MysqL ERROR 1045 (28000): Access denIEd for user root@ localhost问题的解决方法,希望对您有用。如果有疑问,可以联系我们。

MysqL实例

第一种方式:MysqL实例

skip-grant-tables:异常有用的MysqL启动参数MysqL实例

介绍一个非常有用的MysqL启动参数―― --skip-grant-tables.顾名思义,就是在启动
MysqL时不启动grant-tables,授权表.有什么用呢?当然是忘记管理员暗码后有用.MysqL实例

以命令行参数启动MysqL:# /usr/bin/MysqLd_safe --skip-grant-tables &MysqL实例

3、修改管理员暗码:MysqL实例

use MysqL;MysqL实例

update user set password=password('yournewpasswordhere') where user='root'; flush privileges; exit;MysqL实例

4、杀死MysqL,重启MysqL.MysqL实例

然后就可以直接登录MysqL实例

办法2:MysqL实例

查看MysqL安装的路径MysqL实例

MysqL实例

然后我们更改root用户的暗码,MysqL实例

查看默认暗码先MysqL实例

MysqL实例

然后直接登录MysqL实例

MysqL实例

然后再更改root默认用户名和暗码
MysqL实例

GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDentifIEd by '暗码';flush privileges;

  MysqL>update MysqL.user set password=password('新暗码') where User="test" and Host="localhost";MysqL实例

  MysqL>flush privileges;MysqL实例

MysqL实例

  MysqL>delete from user where User='root' and Host='localhost';MysqL实例

  MysqL>flush privileges;MysqL实例

MysqL>grant select,delete,update,create,drop on *.* to test@"%" IDentifIEd by "1234";MysqL实例

MysqL> UPDATE user SET Host='127.0.0.1' WHERE User='root' AND Host='localhost';

MysqL> flush privileges;MysqL实例

MysqL实例

把Grant_priv改动为‘Y'即可(flush privileges;(执行该语句或重启MysqL后生效)),update MysqL.user set Grant_priv='Y' where user='ptmind';MysqL实例

《MysqL入门ubuntu系统中MysqL ERROR 1045 (28000): Access denIEd for user root@ localhost问题的解决方法》是否对您有启发,欢迎查看更多与《MysqL入门ubuntu系统中MysqL ERROR 1045 (28000): Access denIEd for user root@ localhost问题的解决方法》相关教程,学精学透。内存溢出PHP学院为您提供精彩教程。

总结

以上是内存溢出为你收集整理的Mysql入门ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user root@ localhost问题的解决方法全部内容,希望文章能够帮你解决Mysql入门ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user root@ localhost问题的解决方法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1153556.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存