• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

ERROR 1045 (28000): Access denied for user 'ODBC&amp

mysql 搞代码 4年前 (2022-01-09) 27次浏览 已收录 0个评论

http://blog.sina.com.cn/s/blog_586a1f3e01000b82.html 刚使用mysql, 就老是碰到这个问题,真是郁闷, 终于找到原因.. C:\Program Files\MySQL\MySQL Server 5.0\binmysql ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (usingpassword:

http://blog.sina.com.cn/s/blog_586a1f3e01000b82.html


刚使用mysql, 就老是碰到这个问题,真是郁闷, 终于找到原因..
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (usingpassword: N
O)


解决方法:
Step 1:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root-p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28 to server version:5.0.24a-community-nt本文来源gaodai#ma#com搞*代#码9网#

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear thebuffer.

Step 2:
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
mysql>status

正常使用….

------------------------------------------------

我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost'(using password: NO)

使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p password ‘newpassword’
Enter password:
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@’localhost’ (using password:YES)’

现在终于被我找到了解决方法,如下(请先测试方法三,谢谢!):
方法一:
# /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’) whereUSER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password:

mysql>

方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
Enter password:
mysql> UPDATE user SET Password=PASSWORD(‘newpassword’) whereUSER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

# mysql -uroot -p
Enter password:

mysql>

方法三:
这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!!
# mysql -uroot -p
Enter password:

至此,困惑多时的问题解决了!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:ERROR 1045 (28000): Access denied for user 'ODBC&amp

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址