Stay organized with collections Save and categorize content based on your preferences.
OverviewA 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:
SELECT DISTINCT DEFINER FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA NOT
IN ('mysql', 'sys');
SELECT DISTINCT DEFINER FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA NOT
IN ('mysql', 'sys');
SELECT DISTINCT DEFINER FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA NOT
IN ('mysql', 'sys');
SELECT DISTINCT DEFINER FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA NOT
IN ('mysql', 'sys');
To run a migration job from a source which includes such metadata, you can do one of the following:
Create the users on the destination Cloud SQL replica instance before starting your migration job.
Create a migration job without starting it. That is, choose Create instead of Create & Start.
Create the users from your source MySQL instance on your destination Cloud SQL instance using the Cloud SQL API or UI.
Start the migration job from the migration job list or the specific job's page.
Update the DEFINER
clause to INVOKER
on your source MySQL instance prior to setting up your migration job.
'root'@'localhost'
, the process will fail. Change the definer to a different user before starting the migration job.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["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."],[[["MySQL migration jobs do not migrate user data, leading to potential failures when metadata defined with the `DEFINER` clause is invoked on the new Cloud SQL replica if the users are not present."],["You can identify which `DEFINER` values exist in your metadata by running specific queries on your MySQL source database, checking for `root%localhost` or users absent in the destination instance."],["To 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 `DEFINER` clause to `INVOKER` on the source MySQL instance."],["Metadata created by `'root'@'localhost'` will cause the process to fail, and you will need to change the definer to a different user before starting the migration."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4