问题
我用Ubuntu13.10安装了一台PC,安装了mysql-server-5.5.35和phpmyadmin-4.4.0.9-1。使用phpmyadmin,我创建了用户‘jeby6372’和‘内部’,设置了密码,并为每个用户设置了读/写/插入/删除全局权限。
我不能连接用户,而只能根植于Mysql服务器。
反馈
jeby6372@mercure:~$ mysql --version
mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.2根下连接:
jeby6372@mercure:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 123
Server version: 5.5.35-0ubuntu0.13.10.2 (Ubuntu)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 连接其他用户:
jeby6372@mercure:~$ mysql -u jeby6372 -p
Enter password:
ERROR 1045 (28000): Access denied for user 'jeby6372'@'localhost' (using password: YES)内部用户的问题是一样的。
下面是通过phpmyadmin视图获得的权限配置快照:

当我通过phpmyadmin创建用户时,它可能会在更新mysql数据库中的密码时出错,因此我在MySql根目录下运行:
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SET PASSWORD FOR 'jeby6372'@'localhost' = PASSWORD('mypassword');ERROR 1133 (42000): Can't find any matching row in the user table
mysql> SET PASSWORD FOR 'jeby6372'@'%' = PASSWORD('alpha1237');
Query OK, 0 rows affected (0.00 sec)
mysql> quit知道吗?
我在其他服务器上有相同的配置,在Ubuntu12.04上运行MySQL5.5.35,它们运行良好。
有什么建议吗?
谢谢你的帮助。
发布于 2014-03-31 17:53:19
%不包括本地主机。当通过套接字(或Windows上的命名管道)连接时,主机是本地主机;通过TCP/IP连接,同一主机被引用127.0.0.1。
因此,在您的示例中,很可能连接类型是套接字,因此jeby6372@%与连接尝试不匹配。这也是默认MySQL安装附带root@localhost和root@127.0.0.1的原因;它们是不同的连接类型。
见#1044 - Access denied for user 'someuser'@'localhost' to database 'somedb'和https://dev.mysql.com/doc/refman/5.1/en/account-names.html
希望这能帮你弄清楚。
https://stackoverflow.com/questions/22729280
复制相似问题