Updated on 2023-02-02 GMT+08:00

Migrating Accounts

Scenarios

During a database migration, accounts need to be migrated separately.

MySQL Databases Operations

During the migration of MySQL databases, there are accounts that can be migrated completely, accounts whose permissions need to be reduced, and accounts that cannot be migrated.

  • Accounts that can be completely migrated refer to the accounts that meet the permission requirements of the destination database. By default, the system automatically migrates the permission of the database account to the destination database.
  • Accounts whose permissions need to be reduced refer to high-level accounts that fail to meet the permission requirements of the destination database, such as super, file, and shutdown. To migrate these accounts, reduce the permissions of the account. Otherwise, the migration fails.

    You can click View in the Remarks column to view detailed information about the permission to be reduced. You can then determine whether the permission reduction will have an impact on your services.

  • Accounts that cannot be migrated indicate that database users cannot meet the migration requirements for certain reasons. These accounts will not be migrated to the destination database. Ensure that services are not affected by these accounts. After the migration is started, any operation of changing the password or permission for these accounts will result in an incremental migration failure.

You can choose whether to migrate the accounts. Perform the following operations to set the database username, permission, and password. The following procedure uses all database users that can be migrated as an example.

The account information consists of account name, permission, and password.

  1. The account name is in the 'Account name'+@+'host' format. host indicates the IP address of the destination database, which is allowed to access the source database. You can change the IP address as required.
  2. By default, account permissions cannot be modified. For accounts that can be migrated (including accounts that can be completely migrated and accounts whose permissions need to be reduced), the system also migrates the permissions of these accounts.

    After the migration is successful, accounts in the destination database are those whose permissions need to be reduced.

  3. Migrate account passwords.

    You can enter new passwords in the Passwords column for specified accounts that can be migrated, or select all accounts that can be migrated and select Set Unified Password to set a unified new password for them. After the migration is successful, you can run DDL statements on the destination database to reset the password.

  4. For accounts whose permissions need to be reduced and accounts that cannot be migrated, you can click View to confirm the remarks before performing the next step. If there are multiple accounts, you can click Confirm All Remarks.

    If an account already exists in the destination database, it cannot be migrated. You can delete it from the destination database. After the deletion, you can continue the migration.