如何为数据库设置SUPER权限

时间:2015-02-25 06:56:40

标签: mysql

当我导入数据并遇到问题时(错误-1)当我尝试谷歌它并从链接http://dev.mysql.com/doc/refman/5.6/en/grant.html#grant-privileges我检查全局权限并使用此id dql编辑器 - GRANT ALL ON TO' dev-1' @' localhost&#39 ;;哪个给我错误-2

error-1
SQL query: 


/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`ars_user465`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `constantcontact_customers_agents` AS select `customers`.`CustomerID` AS `CustomerID`,`customers`.`AgentID` AS `AgentID`,`customers`.`AccountType` AS `CustomerAccountType`,`customers`.`FirstName` AS `CustomerFirstName`,`customers`.`LastName` AS `CustomerLastName`,`customers`.`Address` AS `CustomerAddress`,`customers`.`City` AS `CustomerCity`,`customers`.`State` AS `CustomerState`,`customers`.`Zip` AS `CustomerZip`,`customers`.`Phone` AS `CustomerPhone`,`customers`.`Cell` AS `CustomerCell`,`customers`.`Fax` AS `CustomerFax`,`customers`.`Email` AS `CustomerEmail`,`customers`.`Dob` AS `CustomerDob`,`agents`.`FirstName` AS `AgentFirstName`,`agents`.`LastName` AS `AgentLastName`,`agents`.`CompanyName` AS `AgentCompanyName`,`agents`.`ApiUsername` AS `ApiUsername`,`agents`.`ApiPassword` AS `ApiPassword` from (`customers` join `agents` on((`customers`.`AgentID` = `agents`.`AgentID`)[...]

MySQL said: 
#1227 - Access denied; you need the SUPER privilege for this operation 

error -2 :

#1045 - Access denied for user 'dev-1'@'%' (using password: YES) 

1 个答案:

答案 0 :(得分:0)

error1:您登录的用户需要super权限。

  

错误:1227 SQLSTATE:42000(ER_SPECIFIC_ACCESS_DENIED_ERROR)消息:   拒绝访问;您需要此操作的%s权限

错误2:很可能,您使用(dev-1 @%)登录的用户没有Grant权限。

运行SELECT USER(), CURRENT_USER();以确认您以您认为自己的用户身份登录。

然后运行SELECT user,host,grant_priv from mysql.user where grant_priv = 'Y';确认该用户是否具有GRANT权限。如果不是,则需要以具有GRANT权限的用户身份登录才能分配super权限。 (这些用户localhost通常只是默认值。)