免费注册 查看新帖 |

Chinaunix

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

【已解决】mysql导入数据,权限不足 [复制链接]

论坛徽章:
1
2015亚冠之本尤德科
日期:2015-06-05 17:25:48
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-08-02 15:23 |只看该作者 |倒序浏览
本帖最后由 cenalulu 于 2012-08-03 10:18 编辑

[root@mysql-n1 ~]# /usr/local/mysql55/bin/mysql -uzsd_oper -pzsd_oper -S /data/mysqldata/3306/mysql.sock zsd<t_wiki_zsd.sql
ERROR 1044 (42000) at line 34: Access denied for user 'zsd_oper'@'localhost' to database 'zsd'

[root@mysql-n1 ~]# /usr/local/mysql55/bin/mysql -S /data/mysqldata/3306/mysql.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.5.25-log zsd edition

Copyright (c) 2000, 2011, 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> show grants for zsd_oper@'localhost';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for zsd_oper@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'zsd_oper'@'localhost' IDENTIFIED BY PASSWORD '*29DB2514EC50AA394BE19A16E6E610FE0870F2DD' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `zsd`.* TO 'zsd_oper'@'localhost'                         |
+-----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql>

dump的时候报我权限不足,我进去查看zsd_oper发现有对应数据库的权限,这是为什么?

论坛徽章:
1
2015亚冠之本尤德科
日期:2015-06-05 17:25:48
2 [报告]
发表于 2012-08-02 15:27 |只看该作者
说错了,是导入数据的时候,权限不足

论坛徽章:
1
2015亚冠之本尤德科
日期:2015-06-05 17:25:48
3 [报告]
发表于 2012-08-02 15:51 |只看该作者
问题解决了还少了两种权限:

论坛徽章:
1
2015亚冠之本尤德科
日期:2015-06-05 17:25:48
4 [报告]
发表于 2012-08-02 15:52 |只看该作者
mysql> grant LOCK TABLES on zsd.* to zsd_oper@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant alter on zsd.* to zsd_oper@'localhost';
Query OK, 0 rows affected (0.00 sec)

由于dump出来的文件里面有锁表和alter操作。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP