2017-07-11 56 views
0

獲取錯誤depsite看似有權限執行SELECT和其他特權ERROR 1142(42000):SELECT命令剝奪了用戶管理'@ 'localhost' 的表 '用戶'

mysql> show privileges; 
+-------------------------+---------------------------------------+-------------------------------------------------------+ 
| Privilege    | Context        | Comment            | 
+-------------------------+---------------------------------------+-------------------------------------------------------+ 
| Alter     | Tables        | To alter the table         | 
| Alter routine   | Functions,Procedures     | To alter or drop stored functions/procedures   | 
| Create     | Databases,Tables,Indexes    | To create new databases and tables     | 
| Create routine   | Databases        | To use CREATE FUNCTION/PROCEDURE      | 
| Create temporary tables | Databases        | To use CREATE TEMPORARY TABLE       | 
| Create view    | Tables        | To create new views         | 
| Create user    | Server Admin       | To create new users         | 
| Delete     | Tables        | To delete existing rows        | 
| Drop     | Databases,Tables      | To drop databases, tables, and views     | 
| Event     | Server Admin       | To create, alter, drop and execute events    | 
| Execute     | Functions,Procedures     | To execute stored routines       | 
| File     | File access on server     | To read and write files on the server     | 
| Grant option   | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess | 
| Index     | Tables        | To create or drop indexes        | 
| Insert     | Tables        | To insert data into tables       | 
| Lock tables    | Databases        | To use LOCK TABLES (together with SELECT privilege) | 
| Process     | Server Admin       | To view the plain text of currently executing queries | 
| Proxy     | Server Admin       | To make proxy user possible       | 
| References    | Databases,Tables      | To have references on tables       | 
| Reload     | Server Admin       | To reload or refresh tables, logs and privileges  | 
| Replication client  | Server Admin       | To ask where the slave or master servers are   | 
| Replication slave  | Server Admin       | To read binary log events from the master    | 
| Select     | Tables        | To retrieve rows from table       | 
| Show databases   | Server Admin       | To see all databases with SHOW DATABASES    | 
| Show view    | Tables        | To see views with SHOW CREATE VIEW     | 
| Shutdown    | Server Admin       | To shut down the server        | 
| Super     | Server Admin       | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. | 
| Trigger     | Tables        | To use triggers          | 
| Create tablespace  | Server Admin       | To create/alter/drop tablespaces      | 
| Update     | Tables        | To update existing rows        | 
| Usage     | Server Admin       | No privileges - allow connect only     | 
+-------------------------+---------------------------------------+-------------------------------------------------------+ 
31 rows in set (0.00 sec) 
+0

嘗試授予權限如下圖所示,並嘗試 GRANT SELECT ON *。*管理員@ 'localhost' 的IDENTIFIED BY「[USER PASSWORD ]'; – lsiva

回答

0

MySQL docs採取

SHOW PRIVILEGES顯示MySQL服務器支持的系統權限列表。確切的權限列表取決於您的服務器的版本。

你在輸出中看到的只是可用的權限的列表。不是用戶擁有的。

要確定您的特權,你必須運行SHOW GRANTS

權限屬於特定用戶通過SHOW GRANTS聲明被顯示。有關更多信息,請參見第13.7.5.21節「SHOW GRANTS語法」。

在你的情況,你需要再次以root身份運行SHOW GRANTS FOR 'admin';

相關問題