Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MySQL i prawa do CREATE VIEW

9 views
Skip to first unread message

"Bartłomiej F. Tajchman"

unread,
Aug 24, 2009, 1:22:00 AM8/24/09
to
Witam!

MySQL 5.0.45. Pr�buj� nada� prawa to u�ywania widok�w userowi, user si�
(s�usznie) skar�y, �e dostaje:

ERROR 1142 (42000): CREATE VIEW command denied to user 'xx'@'localhost'
for table 'cos'

Prawa nadajďż˝:

mysql> GRANT CREATE VIEW ON xx.* TO 'zz'@'localhost';
Query OK, 0 rows affected (0.00 sec)

i nic:

mysql> select * from db where user = 'xx'\G
*************************** 1. row ***************************
Host: localhost
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Grant_priv: Y
References_priv: Y
Index_priv: Y
Alter_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
1 row in set (0.00 sec)

Nie mam w og�le p�l Create_view i Show_view w tabeli db.

Same widoki w bazie dzia�aj�, jako root mog� zrobi�:

mysql> use mysql
Database changed

mysql> create view bartview as select User from user;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from bartview limit 2;
+----------------+
| User |
+----------------+
| zzzzzzz |
| zzzzzzzzzzzzzz |
+----------------+
2 rows in set (0.00 sec)

Gdzie jest problem?

Pozdrawiam,
Bart�omiej F. Tajchman

Krzysztof Jodłowski

unread,
Aug 24, 2009, 2:01:26 AM8/24/09
to
> Prawa nadajďż˝:
> mysql> GRANT CREATE VIEW ON xx.* TO 'zz'@'localhost';
> Query OK, 0 rows affected (0.00 sec)

Musisz nadaďż˝ prawa:
CREATE VIEW Create_view_priv views
SHOW VIEW Show_view_priv views
http://dev.mysql.com/doc/refman/5.0/en/privileges-provided.html

Mo�e sprawd� czy masz upgrade tabel z poprzedniej wersji MySQL:
To use views if you have upgraded to MySQL 5.0.1 from an older release,
you should upgrade your grant tables so that they contain the
view-related privileges:
http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html


--
pozdrawiam
Krzysztof Jod�owski

WYSY�KOWO.PL - Sklep Internetowy
http://www.wysylkowo.pl

0 new messages