- 论坛徽章:
- 0
|
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 |
|