日期:2014-05-16  浏览次数:20671 次

mysql安装问题 The security setting could not be applied to the database 解决办法
转载http://www.onlycto.com/tech/1000/61.html

引用
相信有朋友遇到过这个问题,特别是不是第一次安装mysql的朋友。
说明:我所说的都是在windowsXP系统下的mysql问题
问题描述一般是
“The security setting could not be applied to the database because the connection has
failed with the following error”

网上的办法一般是
1、将原来的mysql卸载掉,然后把安装目录手动清除
2、在注册表中查询mysql,删除注册表信息
3、将3306(mysql端口)在防火墙中放行
以上两步,如果能解决问题最好了,你可以试试


我的系统是win7,没成功,我是用下面的方法解决的

引用
不过,我的问题还是通过下面的办法解决。
重要提示:如果你的mysql服务总是无法启动,则在安装的时候,将mysql服务换个名称,比如 mysql501
1. 如果你的mysql实例配置向导失败了,取消此向导,进入到 windows系统的 服务界面(通过在 运行 中 录入 services.msc ,然后回车可进入服务界面),将mysql服务停止
2. 再次执行mysql实例向导(此时mysql服务应该启动了)
—可通过 开始->mysql ->实例配置向导 打开实例配置向导
3.如果第4步失败(Apply Security Settings),取消此向导
4. 创建一个 txt文件 (例如 C:\mysqlpassword.txt)),文件内容如下:
UPDATE mysql.user SET Password=PASSWORD(’mypassword’) WHERE User=’root’;
FLUSH PRIVILEGES;
5.打开命令行窗口并且执行如下命令
“C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld” –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.1\my.ini” –init-file=C:\mysqlpassword.txt –standalone –console
执行完后,保持窗口不关闭
6.打开另外一个命令行窗口,执行如下命令
“C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin” -u root -p shutdown
(输入在 mysqlpassword.txt 中指定的密码)
7、再次执行 mysql 实例配置向导,Apply Security Settings应该能成功了
祝你好运!
此办法是从此http://bugs.mysql.com/bug.php?id=18555找到的


虽然执行第6步时报错了,但是不影响,直接进行第7步即可
错误是
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin: connect to server at 'lo
calhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'