今天使用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. thinkphp操作完提示信息该怎么弄成弹出层啊?

    http://www.thinkphp.cn/topic/21929.html 浏览:11879 发布日期:2014/08/22 分类:求助交流 关键字: thinkphp success跳转 弹出层 ...

  2. RGB颜色设置错误

    [UIColor colorWithRed:<#(CGFloat)#> green:<#(CGFloat)#> blue:<#(CGFloat)#> alpha:& ...

  3. Django_xamin注册model错误

    可能出现的错误: 1. xadmin.sites.AlreadyRegistered: The model UserProfile is already registered 2. error:Fie ...

  4. python_改变字符串中文本格式?

    案例: 某软件的日志文件,其中日期格式为year-moth-day: 2016-04-21 10:50:30 python 2014-05-22 10:50:30 python 2017-06-23 ...

  5. JavaScript 教程:对象

    JavaScript 对象是拥有属性和方法的数据.学过编程语言的都知道,此处不再详述! 1.对象的定义: <script> </script> 对象也可以先创建,再添加属性和属 ...

  6. VMware PowerCLi 使用示例

    这几天研究PowerCLI,积累了几个例子,记下来,以便以后或者大家使用.部分例子来着网络,具体出处参考附录 1 获取vm 磁盘 和磁盘对应的datastore的信息 这个例子可以针对一台虚机有多个磁 ...

  7. JDBC (五)

    1 使用dbutils进行一对多.多对多的开发 1.1 准备 mysql驱动的pom.xml <!-- https://mvnrepository.com/artifact/mysql/mysq ...

  8. curl错误码说明

    1.得到错误码 $errno=curl_errno($ch); if($errno!=0){ -- } 2.错误码说明 <?php return [ '1'=>'CURLE_UNSUPPO ...

  9. 【转】fread函数详解

    “fread”以二进制形式,从文件读出数据. 语法1:[a,count]=fread(fid,size,precision) 语法2:[a,count]=fread(fid,size,precisio ...

  10. TensorFlow-相关 API(学习笔记 )

    1.tf.nn.conv2d conv2d( input, filter, strides, padding, use_cudnn_on_gpu=True, data_format='NHWC', n ...