Create and run a MySQL migration job containing metadata with a DEFINER clause
Stay organized with collections
Save and categorize content based on your preferences.
Overview
A MySQL migration job
doesn't migrate user data. Therefore,
sources which contain metadata defined by users with the DEFINER clause will
fail when invoked on the new Cloud SQL replica, because the users don't yet
exist there.
To identify which DEFINER values exist in your metadata, you can run the
following queries on your MySQL source database. Check the results for entries for
either root%localhost or for users that don't exist in the destination instance:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eMySQL migration jobs do not migrate user data, leading to potential failures when metadata defined with the \u003ccode\u003eDEFINER\u003c/code\u003e clause is invoked on the new Cloud SQL replica if the users are not present.\u003c/p\u003e\n"],["\u003cp\u003eYou can identify which \u003ccode\u003eDEFINER\u003c/code\u003e values exist in your metadata by running specific queries on your MySQL source database, checking for \u003ccode\u003eroot%localhost\u003c/code\u003e or users absent in the destination instance.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure a successful migration, you must either create the necessary users on the destination Cloud SQL replica before starting the migration job, or update the \u003ccode\u003eDEFINER\u003c/code\u003e clause to \u003ccode\u003eINVOKER\u003c/code\u003e on the source MySQL instance.\u003c/p\u003e\n"],["\u003cp\u003eMetadata created by \u003ccode\u003e'root'@'localhost'\u003c/code\u003e will cause the process to fail, and you will need to change the definer to a different user before starting the migration.\u003c/p\u003e\n"]]],[],null,[]]