Windows2003服务器MySql1045 错误

WBOY
Release: 2016-06-07 17:52:19
Original
1049 people have browsed it

有经验的的朋友都知道1045是密码不正确,后面还应该带有一句Access denied for user root@\'localhost’ (using password:YES)提示,如果你是不知道密码可如下操作。

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服

如果你是要修改密码可以尝试

代码如下 复制代码

mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD(‘你的新密码’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

还有一种绝招了,就是你的在一台密码正常的mysql表中,把user复制过来,这时就可以正常使用密码了哦,不过本人不建义这样做,这样做有可能对权限设置会有些问题哦

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!