安装MYSQL 出现Error 1045 access denied 的解决方法
操作系统:WINDOWS10 系统
数据库版本:mysql 5.x
提示:access denied for user 'root'@'localhost' using password yes/no
原来都好好的,今天开机上来提示上面的这个错误,重启 MySQL 还是不可以。
注意我这里的环境是 WINDOWS-XP 系统,LINUX 系统下的操作没有验证过,情况不清楚。
1. 管理员登陆系统,停止 MySQL 服务或者结束 MySQL 进程。
2. 启动 WINDOWS 的命令行窗口(即通常的 DOS 窗口:运行cmd),切换到你的 “MySQL\bin” 目录下。
例如我的是 “D:\Program Files\MySQL\MySQL Server 5.2\bin”,然后执行下面的粗体的命令:(注意你的 “my.ini” 位置)
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd D:\Program Files\MySQL\MySQL Server 5.2\bin
C:\Documents and Settings\Administrator>d:
D:\Program Files\MySQL\MySQL Server 5.2\bin>mysqld --defaults-file="D:\Program Files\MySQL\MySQL Server 5.2\my.ini" --console --skip-grant-tables
100608 9:04:12 InnoDB: Started; log sequence number 0 46409
100608 9:04:12 [Note] mysqld: ready for connections.
Version: '5.2.0-falcon-alpha-community' socket: '' port: 3306 MySQL Community
Server (GPL)
100608 9:06:57 [Warning] Found invalid password for user: 'root@localhost'; Ign
oring user
只要出现上面信息,就说明 MySQL 已经起来了。
3. 不关闭此命令行窗口,重新打开一个命令行窗口,同样切到 “MySQL\bin” 目录下,然后执行下面的粗体的命令:
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd D:\Program Files\MySQL\MySQL Server 5.2\bin
C:\Documents and Settings\Administrator>d:
D:\Program Files\MySQL\MySQL Server 5.2\bin>mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.2.0-falcon-alpha-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
然后,就是重新设置密码了!
mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
4. 好了到此步,可以关闭第一个 DOS 窗口了(关闭服务)。打开系统服务控制窗口(控制面板--管理工具--服务),启动 MySQL 服务。
5. 在剩下的第二个 DOS 窗口中,用新的 ROOT 密码连接 MySQL。
D:\Program Files\MySQL\MySQL Server 5.2\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.2.0-falcon-alpha-community-nt MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
Bye
至此,系统恢复 ROOT 用户管理权限完成,就是管理员密码的问题。
安装MYSQL 出现Error 1045 access denied 的解决方法的更多相关文章
- Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes
Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes http://blog.csdn.n ...
- Mysql相关问题-----1045 Access denied for user 'root'@'localhost' (using password: YES)报错
MySQL 连接错误,使用Navicat连接MySQL出现错误:1045 Access denied for user 'root'@'localhost' (using password: YES) ...
- windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案
win7 MySql5.6.17提示:1045 access denied for user 'root'@'localhost' using password yes 从网上找到的解决方法,以此博客 ...
- ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)(转)
前两天也偶尔出现这个错误,也没在意,因为我重新修改一下mysql的root密码后又可以用了,但昨天却不行,我把root密码修改以后虽然当时能用, 一旦重新进入就都不能用了,可我的密码明明没有错啊?今天 ...
- Win7环境下mysql报错1045:Access denied for user root@localhost错误解决方法
产生场景:在涉及到连接数据库操作的时候,会报1045:Access denied for user root@localhost. 比如:本地建立的数据库连接不上,在IDEA等开发工具中使用反向生成. ...
- 【linux】Centos下登陆mysql报错#1045 - Access denied for user 'root'@'localhost' (using password: NO)
创建mysql 远程链接 grant all privileges on *.* to 'test'@"%" identified by "test666 with g ...
- tomcat管理页面403 Access Denied的解决方法
安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件里面 ...
- tomcat8 管理页面403 Access Denied的解决方法
安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件 ...
- centos 安装mysql 登录进提示 Access denied for user 'root'@'localhost' (using password: NO)
# service mysqld stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql ...
随机推荐
- memcached-win32-1.4.4-14 help doc
memcached-win32-1.4.4-14 cmd打开命令窗口,转到解压的目录,输入 “memcached.exe -d install”. 使用telnet命令 验证缓存服务器是否可用.tel ...
- [转]HTTP Error 400. The request hostname is invalid.
一般看到网站提示Bad Request(Invalid Hostname)错误我们都会说是iis,apache出问题了,iis出现这种问题解决办法大概是:IIS> 默认网站> > 属 ...
- c/c++多级指针
c/c++多级指针 如图: # include <stdio.h> int main(void) { ; int * p = &i; //p只能存放int类型变量的地址 int * ...
- [转贴]JAVA 百度地图SDK地图学习——实现定位功能
之前已经完成了百度地图SDK和百度定位SDK的配置. http://my.oschina.net/u/1051634/blog/180880 实现百度定位的功能,最好仔细看看官方的文档,看了好几次才有 ...
- 【Spring】Spring IOC原理及源码解析之scope=request、session
一.容器 1. 容器 抛出一个议点:BeanFactory是IOC容器,而ApplicationContex则是Spring容器. 什么是容器?Collection和Container这两个单词都有存 ...
- WPF WebBroswer可以用到的接口
http://pinvoke.net/default.aspx/Interfaces.DWebBrowserEvents2 [ComImport, SuppressUnmanagedCodeSecur ...
- C++中new和不new的区别
我们都知道C++中有三种创建对象的方法,如下: 复制代码代码如下: #include <iostream>using namespace std; class A{private: ...
- JavaScript日期时间操作
<script> var d=new Date();//当前时间 alert(d); var d1=new Date(1992,5,19);//定义一个时间,月份要加1; alert(d1 ...
- UVA_1025_A_Spy_in_the_Metro_(动态规划)
描述 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&a ...
- java基于xml配置的通用excel单表数据导入组件(三、负责数据转换处理的类)
package xxxxxxx.manage.importexcel; import java.util.Map; import java.util.logging.Logger; import xx ...