Mysql – How to get Super Priviledge for a database on an online server

MySQLpermissionsview

Can someone please look at this MySQL statement and suggest to me what to do, for each time I run the code below, I get the following error:

1227 – Access denied; you need the SUPER privilege for this operation

CREATE 
   ALGORITHM=UNDEFINED 
   DEFINER=`bbamas_cat`@`localhost` 
   SQL SECURITY DEFINER 
VIEW `pay_rep_view`  AS  
select 
   `pay`.`id` AS `id`,`pay`.`pay_date` AS `pay_date`,`pay`.`pay_amount` AS `pay_amount`
   ,`pol`.`pol_number` AS `pol_number`,`pol`.`pol_hold` AS `pol_hold`
   ,`pol`.`pre_amnt` AS `pre_amnt`,`pol`.`com_date` AS `com_date`
   ,`in_comp`.`id` AS `in_comp_id`,`in_comp`.`in_comp` AS `in_comp`
   ,`in_brok`.`id` AS `brok_id`,`in_brok`.`in_brok` AS `in_brok`
   ,`pay`.`pay_type` AS `pay_type` 
from ((
  (`pay` join `pol` on((`pay`.`pol_id` = `pol`.`id`))) 
  left join `in_comp` on((`pol`.`in_comp_id` = `in_comp`.`id`))) 
  left join `in_brok` on((`pol`.`brok_id` = `in_brok`.`id`)))

Best Answer

I question whether you asr asking the correct question:

  • Are you bbamas_cat@localhost? If so, leave out the DEFINER clause.
  • Do you really want the VIEW to be run only as bbamas_cat@localhost? Usually one wants to run things as root or as INVOKER.

To get SUPER, normally you connect to MySQL as the user root. I say "normally" because that is nothing to force root to be GRANTed SUPER, nor is there anything to prevent other users from being GRANTed SUPER.