What Can I Do If the Invoking Permission Problem Occurs After the MySQL Stored Procedure Is Migrated to the Cloud?
After the MySQL stored procedure is migrated to the cloud, an error may occur when the stored procedure or function is invoked due to permission problems.
The method varies with Definer policies. This section uses user1 as an example to describe how to solve this problem in two Definer policies.
Policy 1
On the Destination Database page, enter the database username user1, and select OK for Migrate Definer to User.
In this policy, after the Definers of all stored procedures and methods in the source database are migrated to the destination database, the account is automatically changed to user1, and the value of host is automatically changed to %. If a stored procedure fails to be invoked in the destination database, perform the following operations:
- Log in to the RDS for MySQL DB instance of the destination database as the user1.
- Grant the execute permission to the account that you want to use to invoke a stored procedure.
- Run the following statement to use user1 to grant other accounts the permission to execute stored procedures:
user indicates other accounts that need to invoke the stored procedure.
GRANT EXECUTE ON db.* TO user;
- To invoke a stored procedure using Java, run the following statement to use user1 to grant other accounts the permission to query the mysql.proc table:
The following is the authorization statement, in which user indicates the account that needs to invoke the stored procedure:
GRANT SELECT ON mysql.proc TO 'user'@'%';
Policy 2
On the Destination Database page, enter the database username user1, and select Cancel for Migrate Definer to User.
In this policy, the account and host in the source database remain unchanged after the Definers of all stored procedures and methods are migrated to the destination database. You need to migrate all users in the source database by referring to Migrating Accounts. In this way, the permission system of the source database remains unchanged.
If you do not migrate account permissions or some accounts cannot be migrated, you are advised to use Policy 1.
Real-Time Migration FAQs
- When Can I Stop a Migration Task?
- How Do I Maintain the Original Service User Permission System After Definer Is Forcibly Converted During MySQL Migration?
- What Can I Do If the Invoking Permission Problem Occurs After the MySQL Stored Procedure Is Migrated to the Cloud?
- How Do I Ensure that All Services on the Database Are Stopped?
- What Can I Do When Message "can not get agency token" Is Displayed in the Migration Log
- What Do I Do If the Maximum Index Length Has Been Reached During Migration from Oracle to MySQL?
- Why Is the Collation of Heterogeneous or Oracle Databases Converted to utf8mb4_bin After Those Databases Are Migrated to MySQL?
- What Can I Do If MyISAM Tables Are Not Supported by RDS for MySQL?
- What Are the Precautions for Migrating Data from an Earlier Version MySQL to MySQL 8.0?
- What Can I Do When OOM Occurs During the Migration of MongoDB Databases?
- How Do I Disable the Balancer?
- How Do I Export and Import Events and Triggers in Batches?
- How Can I Migrate Databases or Tables Whose Names Contain Uppercase Letters?
- How Do I Delete Orphaned Documents in MongoDB Sharded Clusters?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more