在 MySQL 中,我有一个用户,其密码中包含“<”。
CREATE USER me IDENTIFIED BY 'ab>cd';
我可以使用 MySQL 查询浏览器使用这个用户名和密码完美登录。伟大的。但是当我尝试使用命令行登录时,它失败了。
C:\Program Files\MySQL\Server\bin>mysql -u me -pab>cd
ERROR 1045 (28000): Access denied for user 'me'@'localhost' (using password: YES)
不幸的是,这似乎导致我的 .NET 应用程序中的 MySQL 连接字符串出现同样的问题,因为我收到了相同的异常消息。
当然,这可以正常工作...
CREATE USER me2 IDENTIFIED BY 'abcd';
和
C:\Program Files\MySQL\Server\bin>mysql -u me2 -pabcd
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.1.31-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
有什么帮助吗?