MySQL提示:1045 access denied for user 'root'@'localhost' using password yes
来源:互联网 发布:淘宝家具内容营销 编辑:程序博客网 时间:2024/05/17 05:15
方法一:
# /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:\mysql\bin\mysqld-nt --skip-grant-tables 启动mysql,关闭权限的检查
4. 运行 d:\mysql\bin\mysqladmin -u root flush-privileges password "newpassword" 重设root密码
5. 重新启动mysql服务
第4步也可以直接修改mysql表,所用到的SQL语句同linux部分,这里就不再重复了.
- windows mysql提示:1045 access denied for user'root'@'localhost' using password yes
- MySQL提示:1045 access denied for user 'root'@'localhost' using password yes
- Mysql登录提示1045 error:access denied for user 'root'@'localhost <using password: yes>
- MYSQL 提示:1045 access denied for user 'root'@'localhost' using password yes
- windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案
- windows mysql提示:1045 access denied for user'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案
- MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- windows mysql提示:1045 access denied for user'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- DEBUGGING THE DREADED
- 用DirectShow实现QQ的音视频聊天功能
- Linux下轻松实现PDF文件的合并 转自:http://www.linuxidc.com/Linux/2007-10/8585.htm
- sscanf使用介绍
- boost::weak_ptr和enable_shared_from_this
- MySQL提示:1045 access denied for user 'root'@'localhost' using password yes
- 心情复杂 程序员!? 前路一片迷茫……写给自己(我木有人格分裂啊)
- DirectShow 学习之 CSource类和其一个具体实现例子的源代码分析
- google-perftools
- 敏捷个人2011.8月份线下活动报道:敏捷个人和敏捷结果,设计你的一天,设计你的一周
- MySQL出错代码:1067
- java性能优化
- jquery随记----ajax基于请求加载数据(追加html)
- MyEclipse Enterprise Workbench 9.0 破解及注册机