MySQL

MySQL Import Error : Access Denied

Sometimes, an error occurred when you try to import mysql database after exporting from cpanel. I’m not searching thoroughly the cause but the problem is mysql cannot create VIEW or any STORE PROCEDURE because there is a flag command we’ve been using. Should you find this script in your VIEW or PROCEDURE :

CREATE ALGORITHM = UNDEFINED DEFINER = sumthinamiss@% SQL SECURITY DEFINER VIEW v_sapi AS SELECT a_pa.PA_ID AS PA_ID , a_pa.PA_KODE AS PA_KODE , a_pa.PA AS PA , a_pa.PMRTH_ID AS PMRTH_ID….

I suppose an error will show up like this:

#1227 – Access denied; you need (at least one of) the SUPER privilege(s) for this operation

There are two ways to fix it. You import the sql dump using root and I’m afraid not everyone can be a root in cpanel. So there is another way. Edit your sql script. Remove the line :

ALGORITHM = UNDEFINED DEFINER = sumthinamiss@% SQL SECURITY DEFINER

Your sql script should becoming like this:

CREATE VIEW v_sapi AS SELECT a_pa.PA_ID AS PA_ID , a_pa.PA_KODE AS PA_KODE , a_pa.PA AS PA , a_pa.PMRTH_ID AS `PMRTH_ID

Leave a Reply

Your email address will not be published. Required fields are marked *