本快速入门将向您介绍如何使用 Database Migration Service 将数据迁移到 Cloud SQL for MySQL。您可以迁移到新的 Cloud SQL 实例,也可以迁移到在 Database Migration Service 外部创建的现有实例。您还可以选择迁移来源中的所有数据库,或仅选择要迁移的特定数据库。如果您及时完成本快速入门中的步骤(包括清理),那么在此期间所创建资源的费用通常不会超过 1 美元。
准备工作
登录您的 Google Cloud 账号。如果您是
Google Cloud的新用户,
请创建账号,以便在
真实场景中评估我们产品的性能。新客户还可以获得 300 美元的免费抵用金,用于
运行、测试和部署工作负载。
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
Database Migration Service 提供各种源数据库选项和连接方法。不同源使用某些连接方法的效果比使用其他方法更好。在本快速入门中,我们假设您在将网络配置为添加入站防火墙规则的环境中使用独立的 MySQL 数据库。源数据库可以位于本地,也可以位于云提供方处。由于我们无法了解您的环境的具体情况,因此无法提供有关网络配置的详细步骤。
在本快速入门中,您将为源数据库引擎 选择 MySQL ,并选择 IP 许可名单 作为网络方法。
创建源连接配置文件
通过创建连接配置文件,您可以创建包含源数据库相关信息的记录。Database Migration Service 会使用连接配置文件中的信息将数据从源数据库迁移到目标 Cloud SQL 数据库实例。
在
控制台 Google Cloud 中,前往 Database Migration Service 连接配置文件页面。