今天使用phpmyadmin登录远程数据库所以改了一些配置,结果回过头来登录本地mysql时来了一句mysql Access denied for user ‘root’@’localhost’ (using password: YES),废了好大劲才解决,所以准备整理一下这类问题。

之前整远程mysql的时候用phpmyadmin登录,所以改了一些配置,结果回来登录本地mysql的时候发现进不去了,重装mysql也没有用,报的是下面的错

[root@www ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
网上百度了之后是可以通过修改用户密码解决
  1停止MySQL服务:service mysqld stop 
  2跳过mysql的密码验证:/usr/bin/mysqld_safe --skip-grant-tables &
  3在不停止当前服务的情况下重开一个shell,进入mysql
  4修改密码:update user set password=password('修改的密码') where user='root' and host='localhost';
  5刷新权限:flush privileges;
  6开启mysql服务
跳过mysql密码验证除了上面的还有一种方法
  1MySQL配置文件my.ini中,在[mysqld]下添加skip-grant-tables 
  2重启MySQL服务 ,进入。
  
 

Access denied for user 'root'@'localhost' (using password: YES)的解决的更多相关文章

  1. 远程连接Linux mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法

    在新安装好的Centos7上刚安装好mysql,准备进去看看,但是登陆的时候,发现报错啦: ERROR 1045 (28000): Access denied for user 'root'@'loc ...

  2. 1045 access denied for user 'root'@'localhost' using password yes的解决方法

    今天把一个项目和项目的数据库都下载到了本地,安装好项目和在本地配置好数据库后,在浏览器登陆项目的后台却出现了以下错误:   后来上百度搜索了好几个答案,都是讲述修改数据库密码的步骤,但是就是没有说明为 ...

  3. phpMyAdmin提示“Access denied for user 'root'@'localhost' (using password: NO)”的解决办法

    一.错误内容 在用thinkPHP登陆phpMyAdmin时遇到以下错误 #1045 - Access denied for user 'root'@'localhost' (using passwo ...

  4. mac os x 安装mysql遇到 Access denied for user 'root'@'localhost' (using password: YES)的解决方法

    最近把开发环境迁移到macbook上,装上mysql启动之后,连接,总是报这个错误.5.5的版本默认密码为空.其实这个错误是root未授权的问题.解决方法如下: 未给localhost root用户授 ...

  5. wamp出现问题#1045 - Access denied for user 'root'@'localhost' (using password: NO)的解决方法

    打开wamp->apps->phpmyadmin目录下面的config.inc.php文件 cfg['Servers'][$i]['verbose'] = 'localhost';$cfg ...

  6. CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法

    1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...

  7. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的解决办法和原因

    这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使按照网上说的在mysqld 下面添加skip-grant-tables也是不行,后来研究了两天,终于找 ...

  8. Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法

    https://www.jb51.net/article/133836.htm 搭建服务器之后只能看见test与infomation_schema两个库 https://www.cnblogs.com ...

  9. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

随机推荐

  1. MLlib--决策树

    转载请标明出处http://www.cnblogs.com/haozhengfei/p/d65ab6ccff684db729f44a947ac9e7da.html 决策树 1.什么是决策树    决策 ...

  2. Linux初学者必知的5个学习网站

    分享几个Linux初学者一定要知道的5个学习网站 工具/原料 有一颗学习Linux的心 电脑 方法/步骤 1 推荐一:鸟哥的Linux私房菜(http://vbird.dic.ksu.edu.tw/) ...

  3. linux如何安装java环境

    linux安装jdk7步骤: 1.首先使用命令查看linux系统版本号: lsb_release -a 11 2.下载对应的jdk版本,笔者使用的是jdk-7u79-linux-x64.tar.gz: ...

  4. React版本更新及升级须知(持续更新)

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 18.0px "PingFang SC Semibold& ...

  5. Python+Selenium安装及环境配置

    一.Python安装 Window系统下,python的安装很简单.访问python.org/download,下载最新版本,安装过程与其他windows软件类似.记得下载后设置path环境变量,然后 ...

  6. ANSI C与C89、C99、C11区别差异

    body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...

  7. pipeline结合GridSearchCV的一点小介绍

    clf = tree.DecisionTreeClassifier() ''' GridSearchCV search the best params ''' pipeline = Pipeline( ...

  8. scrapy_简介页面和详情页面

    如何对提取的URL进行限定? 往上找id和class属性值,进行多次层级选择,进行内容限定 如何实现获取主页所有urls,然后交给scrapy下载后并解析详情页面,返回结果?(文章简介页面和文章详细页 ...

  9. sping中防止定时任务多处运行解决方法

    @Servicepublic class TimerJobService implements LzhTimerJobDao{ Logger logger = LoggerFactory.getLog ...

  10. centos7安装python3.6

    安装python3.6可能使用的依赖 # yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sql ...