access denied for user 'root'@'localhost'
来源:互联网 发布:伊藤诚 知乎 编辑:程序博客网 时间:2024/05/17 00:01
WINDOWS-XP 系统
mysql-5.1.22-noinstall-win32
提示:access denied for user 'root'@'localhost' using passwordyes
前几天都好好的,今天开机上来提示上面的这个错误,重启 MySQL 还是不可以。
在网上搜索了好久,总算找到详细的操作方法了。为了以后不再浪费时间,把她重新整理放到 Blog 里。
注意我这里的环境是 WINDOWS-XP 系统,LINUX 系统下的操作没有验证过,情况不清楚。
1. 管理员登陆系统,停止 MySQL 服务或者结束 MySQL 进程。
2. 启动 WINDOWS 的命令行窗口(即通常的 DOS 窗口),切换到你的 “MySQL\bin” 目录下。
例如我的是 “D:\SERVER\MySQL5122\bin”,然后执行下面的粗体的命令:
(注意你的 “my.ini” 位置)
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents andSettings\MMC>d:
D:\>cdD:\SERVER\MySQL5122\bin
D:\SERVER\MySQL5122\bin>mysqld--defaults-file="D:\SERVER\MySQL5122\my.ini" --console--skip-grant-tables
090801 4:43:54 InnoDB: Started; log sequence number 0 585546
090801 4:43:54 [ERROR] Can't open and lock privilege tables: Table'mysql.servers' doesn't exist
090801 4:43:54 [Note] mysqld: ready for connections.
Version: '5.1.22-rc-community' socket: '' port: 3306 MySQLCommunity Server (GPL)
_
只要出现下面信息,就说明 MySQL 已经起来了。
Version: '5.1.22-rc-community' socket: '' port: 3306 MySQLCommunity Server (GPL)
3. 不关闭此命令行窗口,重新打开一个命令行窗口,同样切到 “mysql\bin” 目录下,然后执行下面的粗体的命令:
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents andSettings\MMC>d:
D:\>cdD:\SERVER\MySQL5122\bin
D:\SERVER\MySQL5122\bin>mysql -u rootmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.22-rc-community MySQL Community Server(GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
到这步,我想任何一个使用 MySQL 的人都知道后面要做什么了!(^a^)
mysql>
mysql> UPDATE user SETPassword=PASSWORD('mynewpass') where USER='root';
Query OK, 2 rows affected (0.05 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
mysql> quit
Bye
4. 好了到此步,可以关闭第一个 DOS 窗口了。打开系统服务控制窗口(控制面板--管理工具--服务),启动 MySQL服务。
5. 在剩下的第二个 DOS 窗口中,用新的 ROOT 密码连接 MySQL。
D:\SERVER\MySQL5122\bin>mysql -u root-p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.22-rc-community MySQL Community Server(GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
Bye
至此,系统恢复 ROOT 用户管理权限完成。
mysql-5.1.22-noinstall-win32
提示:access denied for user 'root'@'localhost' using passwordyes
前几天都好好的,今天开机上来提示上面的这个错误,重启 MySQL 还是不可以。
在网上搜索了好久,总算找到详细的操作方法了。为了以后不再浪费时间,把她重新整理放到 Blog 里。
注意我这里的环境是 WINDOWS-XP 系统,LINUX 系统下的操作没有验证过,情况不清楚。
1. 管理员登陆系统,停止 MySQL 服务或者结束 MySQL 进程。
2. 启动 WINDOWS 的命令行窗口(即通常的 DOS 窗口),切换到你的 “MySQL\bin” 目录下。
例如我的是 “D:\SERVER\MySQL5122\bin”,然后执行下面的粗体的命令:
(注意你的 “my.ini” 位置)
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents andSettings\MMC>d:
D:\>cdD:\SERVER\MySQL5122\bin
D:\SERVER\MySQL5122\bin>mysqld--defaults-file="D:\SERVER\MySQL5122\my.ini" --console--skip-grant-tables
090801 4:43:54 InnoDB: Started; log sequence number 0 585546
090801 4:43:54 [ERROR] Can't open and lock privilege tables: Table'mysql.servers' doesn't exist
090801 4:43:54 [Note] mysqld: ready for connections.
Version: '5.1.22-rc-community' socket: '' port: 3306 MySQLCommunity Server (GPL)
_
只要出现下面信息,就说明 MySQL 已经起来了。
Version: '5.1.22-rc-community' socket: '' port: 3306 MySQLCommunity Server (GPL)
3. 不关闭此命令行窗口,重新打开一个命令行窗口,同样切到 “mysql\bin” 目录下,然后执行下面的粗体的命令:
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents andSettings\MMC>d:
D:\>cdD:\SERVER\MySQL5122\bin
D:\SERVER\MySQL5122\bin>mysql -u rootmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.22-rc-community MySQL Community Server(GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
到这步,我想任何一个使用 MySQL 的人都知道后面要做什么了!(^a^)
mysql>
mysql> UPDATE user SETPassword=PASSWORD('mynewpass') where USER='root';
Query OK, 2 rows affected (0.05 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
mysql> quit
Bye
4. 好了到此步,可以关闭第一个 DOS 窗口了。打开系统服务控制窗口(控制面板--管理工具--服务),启动 MySQL服务。
5. 在剩下的第二个 DOS 窗口中,用新的 ROOT 密码连接 MySQL。
D:\SERVER\MySQL5122\bin>mysql -u root-p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.22-rc-community MySQL Community Server(GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
Bye
至此,系统恢复 ROOT 用户管理权限完成。
0 0
- Access denied for user 'root'@'localhost' 解决方法
- Access denied for user 'root'@'localhost' 解决方案
- Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- access denied for user 'root'@'localhost'
- access denied for user 'root'@'localhost'
- 1045 access denied for user 'root'@'localhost'
- mysql Access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost'
- MySQL Access denied for user 'root'@'localhost'
- Access denied for user \'root\'@\'localhost\'” 解决办法
- Access Denied for user root @localhost 解决方案
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- UML类图符号 各种关系说明以及举例
- android串口通信——电子扫描枪
- 安装igrimace步骤
- JAVA面试题——编程题
- 9.第一章---数据结构绪论
- access denied for user 'root'@'localhost'
- 具有短线爆发力的股票的特征
- SQL Server 的事务和锁(举例)——在其他博客上做些笔误修改
- tomcat reloadable 实现项目自动布署
- Android 中布局,如果有些参数不起作用,那么使用相对布局一般都起作用
- igrimace安装常出现问题 uber 陌陌站街 平安易贷 Z spirit借贷宝
- ios网络请求 get——post 区别
- C# 委托
- 读精益数据分析——序