解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题(转载)
最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
或者
# mysql -u root -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/service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql>
UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and
host='root' or host='localhost';
//把空的用户密码都修改成非空的密码就行了。
mysql> FLUSH PRIVILEGES;
mysql> quit # /etc/init.d/service mysqld restart
# mysql -u root -p
Enter password: <输入新设的密码newpassword>
解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题(转载)的更多相关文章
- 解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)【亲测有效】
文件转自:https://blog.csdn.net/hua1011161696/article/details/80666025 问题:(MySQL 5.6社区版windows版) 忘记密码或其他一 ...
- 解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 这种问题需要强行重新修改密码,方法 ...
- mysql解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)的报错
一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...
- MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
问题描述 安装完MySQL5.5数据库,使用Navicat Premium以及命令窗口连接数据库都报以下错误: ERROR 1045 (28000): Access denied for user ' ...
- 重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
出现报错: Warning: World-writable config file '/etc/my.cnf' is ignored // 该文件权限过高ERROR 1045 (28000): Acc ...
- 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...
- 解决MySQL5.7在MAC下登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题
问题描述 今天在MAC上安装完MYSQL后,MYSQL默认给分配了一个默认密码,但当自己在终端上使用默认密码登录的时候,总会提示一个授权失败的错误:ERROR 1045 (28000): Access ...
- 解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)
一.问题 有时候我们登录Mysql输入密码的时候,会出现这种情况 mysql -u root -p Enter Password > '密码' 错误:ERROR 1045 (28000): Ac ...
- ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法
问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 很久没用这台电脑的mysql ...
随机推荐
- install ros-indigo-laser-geometry
-- Using these message generators: gencpp;genlisp;genpy CMake Warning at /opt/ros/indigo/share/catki ...
- 最全android Demo
1.BeautifulRefreshLayout-漂亮的美食下拉刷新 https://github.com/android-cjj/BeautifulRefreshLayout/tree/Beauti ...
- 【MySQL】经典数据库SQL语句编写练习题——SQL语句扫盲
[MySQL]数据库原理复习——SQL语言 对基本的SQL语句编写的练习题,其中的题目的答案可能会有多种书写方式. 1.题目1 1.1 关系模式 学生student:SNO:学号,SNAME:姓名,A ...
- 09_Git patch(补丁)操作
Git打补丁,补丁操作一般在多人开发时才会用到,单人本地开发一般用不到,没必要. 应用场景举例: 我把我的更改打成一个补丁发给你,你来合并到你的代码中 或者,在家里电脑开发提交后,打一个补丁,拿到 ...
- UVALive 4639 && SPOJ SPOINTS && POJ 3805 && AOJ 1298 Separate Points 求两个凸包是否相交 难度:3
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_probl ...
- IIS上部署DotNet Core程序
1.安装托管捆绑包 https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.1 ...
- String类的concat()方法
String类的concat()方法: public class MyClass { public static void main(String[] args) { String str1=&quo ...
- PostgreSQL常用插件收集
hexdump -C 数据表文件 -- 查看表文件中数据. pg_stat_statements pgcompacttable -- 在减少锁的情况下,清理表和索引的老空间. pg_repack--P ...
- win10中jdk1.8环境配置完,重启之后配置失效
1.win10操作系统下重启电脑java环境变量失效 解决方式: 右击开始按钮,选择管理员方式的windows powershell,如下图: 在窗口中输入javac,一切正常,即使重启都不会有问题啦 ...
- 解决 The word is not correctly spelled问题
The word is not correctly spelled 此问题是eclipse校验单词拼写造成,如果出在配置文件中,一般会影响到程序的正常执行 解决方法:Window--Preferenc ...