代码改变世界

1142 - show view command denied to user

2017-05-03 11:26  abce  阅读(6458)  评论(0编辑  收藏  举报

 

原因是没有给test用户授予"show_view_priv"权限

mysql> SELECT * FROM mysql.user WHERE User = 'test' and Host = '%'\G;
*************************** 1. row ***************************
                  Host: %
                  User: test
              Password: ****************
			  ...
        Show_view_priv: N
			  ...
1 row in set (0.02 sec)

 

授权

mysql> update mysql.user set Show_view_priv = 'Y' where user = 'test' and Host = '%';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>