mysql - 将 MySQL 转储导入 Google SQL - unique_checks=0 是不确定的

标签 mysql google-cloud-sql

我目前正在尝试将 mysqldump(~60GB)(包括触发器和存储的过程)导入到 Google Cloud SQL 数据库实例中。

我已使用 terraform 将 log_bin_trust_function_creators 设置为 true/on,并使用 perl 从触发器中删除了 DEFINER 部分。

我尝试使用 gcloud sql 导入功能和 Web 控制台(从存储桶导入)进行导入,每次在 stackdriver 中都会弹出相同的错误。

严重性:“错误”
textPayload:“2018-06-26T10:48:42.727799Z 87406 [警告]使用unique_checks = 0,这是不确定的!”

Afaik unique_checks 在转储期间设置以加快导入速度。
我在互联网上找不到任何东西。

有人可以告诉我该错误的含义以及如何修复它吗?
我想避免再次转储数据库,因为这需要很长时间。

我必须注意,我只是使用了基本的 mysqldump,没有建议的参数 here因为我刚刚找到这篇文章。

最诚挚的问候,

最大

最佳答案

警告(而不是错误!)与数据导入没有直接关系,而是与目标 MySQL 环境中的复制配置方式相关。

作为 MySQL 文档 Determination of Safe and Unsafe Statements in Binary Logging说(突出显示的是我的):

The “safeness” of a statement in MySQL replication refers to whether the statement and its effects can be replicated correctly using statement-based format. If this is true of the statement, we refer to the statement as safe; otherwise, we refer to it as unsafe.

In general, a statement is safe if it deterministic, and unsafe if it is not.

...

References to system variables. Most system variables are not replicated correctly using the statement-based format. See Section 17.4.1.39, “Replication and Variables”. For exceptions, see Section 5.4.4.3, “Mixed Binary Logging Format”.

unique_checks=0 设置系统变量,代码可能在全局级别设置它,这在基于语句的复制中被认为是不安全的。

更改代码以设置unique_checks=0 on session level (推荐),或change the binary logging type混合

关于mysql - 将 MySQL 转储导入 Google SQL - unique_checks=0 是不确定的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51042468/

相关文章:

java - 从 GCE 实例上的 Tomcat webapp 连接到第二代 MySQL

java - 更新准备好的语句未提交

php - 如何使用 codeigniter 按类别显示产品

google-cloud-sql - 在 C# 中将 Cloud Run 连接到 Cloud SQL Server 实例

python - BrokenPipeError - SQLAlchemy - Cloud SQL - App Engine 标准

mysql - 这是更新表格的错误方法吗

mysql - 选择、更新并返回所选值

postgresql - 将 Google CloudSQL Postgres 数据库连接到 Data Studio

Python Pip 安装失败 - 无法构建 Egg。由于 google cloud sql 也无法使用 1.2.5

Mysql,新的基于区域磁盘的 HA 升级完成。我现在可以禁用 GTID 吗?