错误代码 1045
Access denied for user 'root'@'localhost' (using password:YES)
解决办法是重新设置root用户密码,在Windows平台下操作步骤如下:
1、以系统管理员身份登录到系统;
2、如果MySQL服务器正在运行,停止它。
      如果是作为Windows服务运行的服务器,进入服务管理器:开始菜单->控制面板->管理工具->服务
      如果服务器不是作为服务而运行的,可能需要使用任务管理器来强制停止它。
3、创建1个文本文件,并将下述命令置于单一行中:
      SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
      用任意名称保存该文件。在本例中,该文件为C:\mysql-init.txt。
4、进入DOS命令提示:开始菜单->运行-> cmd
      假定你已将MySQL安装到C:\mysql。如果你将MySQL安装到了另一位置,请对下述命令进行相应的调整。
      在DOS命令提示符下,执行命令:
            C:\> C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt
      在服务器启动时,执行由“--init-file”选项(作用:在启动时从指定的文件中读取SQL命令)命名的文件的内容,更改根用户密码。当服务器成功启动后,应删除C:\mysql-init.txt。
5、停止MySQL服务器,然后在正常模式下重启它。如果以服务方式运行服务器,应从Windows服务窗口启动它。如果以手动方式启动了服务器,能够像正常情形下一样使用命令。
应能使用新密码进行连接。



Error Nr. 1045

Access denied for user 'root'@'localhost' (using password: YES)

If a personal firewall is running on your machine, please make sure you have opened the TCP port 3306 for connections. Otherwise no client application can connect to the server. After you have opened the port please press [Retry] to apply the security settings.

If you are re-installing after you just uninstalled the MySQL server please note that the data directory was not removed automatically. Therefore the old password from your last installation is still needed to connect to the server. In this case please select skip now and re-run the Configuration Wizard from the start menu.

解决方法:

1, 控制面板卸载MySQL

2, 删除目录 C:\Documents and Settings\All Users\Application Data\MySQL

3.只有彻底删除上次install information之后才能安装,为确保起见,去搜索其他的mysql内容,你也有可能在别的地方安装过mysql的。

3, 重新安装MySQL 就好了

如何你C:\Documents and Settings\All Users下没有Application Data文件夹,选择:工具——文件夹选项——查看——选择显示所有文件和文件夹。

以上资料出自http://blog.csdn.net/windzou36/archive/2010/04/07/5460188.aspx

arrow
arrow
    文章標籤
    mysql error 1045
    全站熱搜

    pcwiki 發表在 痞客邦 留言(0) 人氣()