免费注册 查看新帖 |

Chinaunix

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

mysql用户权限 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-10 21:49 |只看该作者 |倒序浏览
10可用积分
在mysql.user权限表中,用户psxbill用户在dbhost主机上有权限,如下所示:
其中dbhost为本地域名,其对应ip即为数据库所在服务器ip,但是用mysql -u psxbill -h dbhost -p 没法连上
另外,已经flush privileges了


mysql> use mysql
Database changed
mysql> select user,host,password from user where user='psxbill';
+---------+------------+-------------------------------------------+
| user    | host       | password                                  |
+---------+------------+-------------------------------------------+
| psxbill | localhost  | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | loghost    | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | webhost    | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | dbhost     | psxbill                                   |
| psxbill | radiushost | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
+---------+------------+-------------------------------------------+
5 rows in set (0.00 sec)



[root@gao bin]# cat /etc/hosts
#Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
xx.xx.xxx.xx    postppr         postppr
xx.xx.xxx.xx    loghost         loghost
xx.xx.xxx.xx    dbhost          dbhost
xx.xx.xxx.xx    webhost         webhost



[root@gao bin]# mysql -u psxbill -h dbhost -p
Enter password:
ERROR 1045 (28000): Access denied for user 'psxbill'@'postppr' (using password: YES)

最佳答案

查看完整内容

你的密码是明文的MySQL不识别的用以下语句改一下update user set password=password('123456') where user='psxbill' and host='psxbill';flush privileges;然后再试一下

评分

参与人数 1信誉积分 -6 收起 理由
枫影谁用了 -6

查看全部评分

论坛徽章:
0
2 [报告]
发表于 2009-03-10 21:49 |只看该作者
你的密码是明文的

MySQL不识别的

用以下语句改一下

update user set password=password('123456') where user='psxbill' and host='psxbill';

flush privileges;

然后再试一下

论坛徽章:
0
3 [报告]
发表于 2009-03-10 22:59 |只看该作者
密码换成加密的了,还是连不上

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
4 [报告]
发表于 2009-03-11 09:04 |只看该作者

回复 #3 protagonist 的帖子

select user,host,password from mysql.user结果看看。
另外你在本机hostname结果是啥?

论坛徽章:
0
5 [报告]
发表于 2009-03-11 09:10 |只看该作者

回复 #4 枫影谁用了 的帖子

mysql> select user,host,password from mysql.user;
+---------+-------------+-------------------------------------------+
| user    | host        | password                                  |
+---------+-------------+-------------------------------------------+
| root    | localhost   | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| root    | gao| *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| root    | 127.0.0.1   | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | localhost   | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | psx         | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | loghost     | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | webhost     | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | dbhost      | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | radiushost  | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | postppr     | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psxconf | localhost   | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psxconf | loghost     | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psxconf | webhost     | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psxconf | dbhost      | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psxconf | radiushost  | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psxconf | postppr     | *159C9E11592F55991B8434AF41D5FF7B24E008C2 |
| psx     | gao| *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psx     | %           | *60236E96E39426EF7260B0A1DB3F9F8D93E5BBD4 |
| psxbill | localhost   | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | loghost     | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | webhost     | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | dbhost      | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
| psxbill | radiushost  | *45DF7BA5A690EE7D781A3AA2FB813E241B76E6D1 |
+---------+-------------+-------------------------------------------+
23 rows in set (0.00 sec)

论坛徽章:
0
6 [报告]
发表于 2009-03-11 15:57 |只看该作者
user 'psxbill'@'postppr'

论坛徽章:
0
7 [报告]
发表于 2009-03-11 18:37 |只看该作者
问题搞定了,主要是有一大堆本地域名,也不明白相互之间是怎么引用的,全部加了权限之后就能访问了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP