免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1366 | 回复: 0
打印 上一主题 下一主题

mysql error 1045(28000) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-29 09:53 |只看该作者 |倒序浏览
C:\Documents and Settings\hp001>mysql
[email=root@localhost]root@localhost[/email]
ERROR 1045 (28000): Access denied for user
[email='ODBC'@'localhost']'ODBC'@'localhost'[/email]
(using password: N0)

E:\mysql\bin>mysql -u root -p
Enter password: ***
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.37-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

[说明:
需要注意的是:
-u 和用户名之间有空格
-p 和密码之间没有空格
比如: mysql -u root -pvmware
也可以-p后留空,然后再输入,这个是比较"安全“的方法,因为看不到密码
]

mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.37, for Win32 (ia32)
Connection id:          10
Current database:
Current user:           
[email=root@localhost]root@localhost[/email]
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.37-community-nt MySQL Community Edition (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               3306
Uptime:                 13 min 51 sec
Threads: 2  Questions: 122  Slow queries: 0  Opens: 25  Flush tables: 1  Open ta
bles: 19  Queries per second avg: 0.147
--------------
mysql> quit
Bye
E:\mysql\bin>mysql
ERROR 1045 (28000): Access denied for user
[email='ODBC'@'localhost']'ODBC'@'localhost'[/email]
(using password: N
O)

尝试另外一种办法:
错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for user的错误.删除user.user中值为NULL的,或更新NULL为test 1)delete from user where user is NULL 2)update user set user=‘test‘ where user is NULL.意外的情况: 如果上述方法没有效果,依然出现空用户,则可以利用图形化用户client删除.
测试结果:
E:\mysql\bin>mysql
ERROR 1045 (28000): Access denied for user
[email='ODBC'@'localhost']'ODBC'@'localhost'[/email]
(using password: N
O)


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44502/showart_370101.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP