windows mysql提示:1045 access denied for user ‘root’@’localhost’ using password yes,该怎么处理

windows mysql提示:1045 access denied for user ‘root’@’localhost’ using password yes

windowsxp系统 mysql-5.0.11-beta-win32

提示:1045 access denied for user ‘root’@’localhost’ using password yes

前几天都好好的,昨天没弄,结果今天晚上过来提示上面的这个错误,重启mysql还是不可以

网上的方法看了几个但是不知道怎么弄


方法一: 

# /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; 

mysql> quit 

# /etc/init.d/mysql restart 

# mysql -uroot -p 

Enter password: <输入新设的密码newpassword> 

mysql> 


方法二: 

直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 

# mysql -udebian-sys-maint -p 

Enter password: <输入[client]节的密码> 

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 

mysql> FLUSH PRIVILEGES; 

mysql> quit 

# mysql -uroot -p 

Enter password: <输入新设的密码newpassword> 

mysql> 

内容来自: www.jb51.net 

另一个方法

Windows:

1. 管理员登陆系统,停止mysql服务或者结束mysqld-nt进程

2. 进入命令行,来到mysql的安装目录.假设安装目录为 d:mysql , CMD进入命令行

3. 运行 d:mysqlbinmysqld-nt –skip-grant-tables 启动mysql,关闭权限的检查

4. 运行 d:mysqlbinmysqladmin -u root flush-privileges password “newpassword” 重设root密码

5. 重新启动mysql服务

第4步也可以直接修改mysql表,所用到的SQL语句同linux部分,这里就不再重复了.

请不要乱给答案否则不给分

一定要试验过的成功经验,谢谢!

少东西了,重新安装吧。这是我目录中的。

BatchFile code

C:Program FilesMySQLMySQL Server 5.1bin>dir mysqld*.exe
 Volume in drive C is xxxxxx
 Volume Serial Number is xxxxxxx-xx

 Directory of C:Program FilesMySQLMySQL Server 5.1bin

03/16/2009  01:28p          10,715,776 mysqld-debug.exe
03/16/2009  01:29p           6,562,432 mysqld.exe
03/16/2009  01:29p           2,331,264 mysqldump.exe
               3 File(s)     19,609,472 bytes
               0 Dir(s)  32,020,001,280 bytes free

C:Program FilesMySQLMySQL Server 5.1bin>


                        
  
  
                    
windows mysql提示:1045 access denied for user ‘root’@’localhost’ using password yes,该怎么处理

相关文章:

你感兴趣的文章:

标签云: