Search code examples
amazon-web-servicesrdsamazon-aurora

Migration from MySQL to Aurora: Unknown database, tables, functions, stored procedures


we were on MySQL 5.6 ; and today migrated to Aurora using snapshot.

Following query on Aurora says "Unknown database products " while it works fine on MySQL DB:

select p.id,products.getSalePlanMinDate(p.id,NOW()) AS minDate from products.product p inner join customers.recently_viewed_products rvp on p.id = rvp.product_id ;

On Aurora ; select * from products.product works fine .. This is happening because I am using function in the query.. If i remove function it works fine

Finally, came to know that even following select does not work:

select products.getSalePlanMinDate();

Even though DEFINER of this function has the permissions to EXECUTE.. and i try logging in with same user as DEFINER


Solution

  • Reason was that opt file was not present for few schemas on that RDS.. I had to raise a ticket with Amazon and they created opt files from background and that resolved the issue.