ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for user的错误.删除user.user中值为NULL的,或更新NULL为test 1)delete from user where user is NULL 2)update user set user=‘test‘ where user is NULL.意外的情况: 如果上述方法没有效果,依然出现空用户,则可以利用图形化用户client删除.
在重装了CentOS后,发觉Mysql一直不好用。
# mysqladmin create dbname 命令老是返回mysqladmin: connect to server at ’localhost’ failed
# mysql -u root@localhost
>create database dbname;
也同样返回错误ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password: NO)
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p password ’newpassword’
Enter password:
mysqladmin: connect to server at ’localhost’ failed
error: ’Access denied for user ’root’@’localhost’ (using password: YES)’
现在终于被我找到了解决方法,如下(请先测试方法三,谢谢!):
方法一:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
Enter password: <输入[client]节的密码>
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
方法三:
这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!
# mysql -uroot -p
Enter password: <输入/etc/mysql/debian.cnf文件中[client]节提供的密码>
至此,困惑多时的问题解决了!
上一篇:如何设置提高.降低Word.Excel宏安全性的问题
栏 目:office教程
本文标题:ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
本文地址:https://zz.feitang.co/wangzhanyunying/13797.html
您可能感兴趣的文章
- 11-262010 Office密钥过期怎么办?Office2010产品激活失败的解决方法
- 11-26office2010产品密钥有哪些?最新office2010激活密钥汇总
- 11-26office2007密钥哪里找?office2007永久密钥序列号
- 11-26Office2016怎么安装?Office2016安装激活教程
- 11-26Office2010最新激活密钥有哪些?Office2010激活密钥分享大全
- 11-26求Office2013密钥?2025最新Office2013激活密钥
- 11-26Office2013电话怎么激活?Office2013永久激活方法
- 11-26office2016打开卡顿怎么办?office2016打开缓慢的解决技巧
- 11-26Office 2010中文版怎么转换为英文版?
- 11-26office 2010激活错误代码0X8007000D如何解决?


阅读排行
- 12010 Office密钥过期怎么办?Office2010产品激活失败的解决方法
- 2office2010产品密钥有哪些?最新office2010激活密钥汇总
- 3office2007密钥哪里找?office2007永久密钥序列号
- 4Office2016怎么安装?Office2016安装激活教程
- 5Office2010最新激活密钥有哪些?Office2010激活密钥分享大全
- 6求Office2013密钥?2025最新Office2013激活密钥
- 7Office2013电话怎么激活?Office2013永久激活方法
- 8office2016打开卡顿怎么办?office2016打开缓慢的解决技巧
- 9Office 2010中文版怎么转换为英文版?
- 10office 2010激活错误代码0X8007000D如何解决?
推荐教程
- 07-012025最新office2010永久激活码免费分享,附office 2010激活工具
- 07-01怎么免费获取2025最新office2016专业增强版永久激活密钥/序列号
- 07-01office365怎么永久激活?2025.5最新office,office365序列号推荐
- 06-25office2021年最新永久有效正版激活密钥免费分享
- 06-13Office 2024激活工具,2025年Office2024激活工具及激活密钥分享
- 05-12Microsoft office2019产品激活密钥(100%永久激活)
- 07-01office2021专业增强版2021激活密钥2023密钥永久激活 万能office202
- 06-17经验分享Win11激活密钥怎么获取(win11专业版激活密钥)
- 07-01office 2021激活码/序列号推荐,office2021附激活工具
- 06-25Office2021激活密钥永久最新分享




