#1045 - Access denied for user 'root'@'localhost' (using password: NO)的问题

问题描述:
 在控制台shell下修改了root的密码,然后在http://localhost/phpmyadmin下无法登录了
  报错:#1045 - Access denied for user ‘root‘@‘localhost‘ (using password: YES)
操作重现:
  mysql -u root -p
  ******  #以前的密码
  use mysql ;
  update user set password=PASSWORD(‘new_passwd‘) where user = ‘root‘ ;  #设置你新的密码
  flush privileges ;
  然后就在phpmyadmin无法登录了
问题原因:
  这是因为在phpmyadmin的配置文件中,原有的密码并没有改变,所以导致登录不上去

解决方法:

方法很简单,找到wamp下的config.inc.php

我的路径是   D:\program files\wamp\apps\phpmyadmin4.1.14\config.inc.php

打开  config.inc.php  找到$cfg[‘Servers‘][$i][‘password‘] = ‘123456‘;

这里的123456 换成你设置的mysql密码就行了,记得保存

---------------------------------------

原创:

为什么mysql改了密码,而phpmyadmin需要改密码呢?

因为phpmyadmin只是一个普通的网站,普通网站连接数据库,肯定需要用配置文件来配置数据库的登陆名和密码的。

所以需要在config.inc.php中重新更正密码。

#1045 - Access denied for user 'root'@'localhost' (using password: NO)的问题

时间: 2024-08-02 06:59:15

#1045 - Access denied for user 'root'@'localhost' (using password: NO)的问题的相关文章

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

如上所示,当我们修改数据库的密码之后,再次进入phpmyadmin的时候,就会产生这种错误#1045 - Access denied for user 'root'@'localhost' (using password: NO) .那这种错误产生的原因是什么呢?解释就是,密码修改后,新旧密码不一致产生的.改正过来其实也很简单,在phpmyadmin3.4.10.1文件夹下找到config.inc.php这个文件,然后找到里面$cfg['Servers'][$i]['password'] = '

Navicat安装后出现错误:1045 - Access denied for user 'root'@'localhost' (using password: YES)

安装完MySQL和N之后,打开Navicat后出现如下错误: **********1045 - Access denied for user 'root'@'localhost' (using password: YES)********** (小插曲:记得不知道这是多少次安装MySQL了,以前用的是SQLyog,突然安装了一个Navicat,尽然出现错误,让自己小小的汗颜了一把!!!经过上网查资料,解决方法陈述下文) [问题所在]:未给root用户分配所有权限. [解决步骤]:例如:用户名:a

mysql提示:1045 access denied for user'root'@'localhost' using password yes

1.打开DOS进入mysql下bin目录(C:\Program Files\MySQL\MySQL Server 5.6\bin) 2.停止mysql服务,net stop  mysql 3.输入:mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini" --console --skip-grant-tables 4.重新打开一个DOS窗口,进入mysql下bin目录,输入:mysql

【zabbix】connection to database 'zabbix' failed: [1045] Access denied for user 'root'@'localhost' (using password: NO)

前面安装的我就不说了,度娘上的很多: 关键是这个问题,网上的比较多,但是没有发现有用的: 问题:zabbix server is runing No 日志:/tmp/zabbix_server.log connection to database 'zabbix' failed: [1045] Access denied for user 'root'@'localhost' (using password: NO) 解决过程: 1)找到安装目录: [[email protected] init

一步解决#1045 - Access denied for user 'root'@'localhost' (using password: NO) 的问题

解决办法是: 在phpMyAdmin中libraries目录下找到config.default.php文件 $cfg['Servers'][$i][ 'host'] = 'localhost';$cfg['Servers'][$i]['port'] = '3306';$cfg['Servers'][$i]['connect_type'] = 'socket'; $cfg['Servers'][$i]['extension'] = 'mysql';$cfg['Servers'][$i]['auth

1045 access denied for user 'root'@'localhost' using password yes

mysql -u root -p 方法一:  # /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;  mys

windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案

简单粗暴 工具xwamp 路径:H:\xampp\mysql\bin\my.ini.php 打开my.ini,在[mysqld]下面添加 skip-external-lockingskip-name-resolveskip-grant-tables 停止mysql ->打开xwamp的shell可以输入命令,如下 Setting environment for using XAMPP for Windows. [email protected]-CGL9PRT h:\xampp # mysql

数据库出现1045 access denied for user 'root'@'localhost' using password yes (转)

在mysql命令行中执行 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456'); GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY '123456' WITH GRANT OPTION; flush privileges;   若以上方法行不通则用: use mysql;  UPDATE user SET Password=PASSWORD('123456') where

解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes

今天想用用MySQL 数据库  谁知道老提示 1045 access denied for user 'root'@'localhost' using password yes 最后在csdn 上找到了答案 来源:http://bbs.csdn.NET/topics/310006640     13楼 解决: 1. 开始 --> cmd   --> net stop mysql  (停用MySQL服务  没启动的可以省略) 2. 找到安装路径 MySQL Server 5.1下的my.ini