this is incompatible with sql_mode=only_full_group_by

在把服務從 AWS 搬到 GCP 的過程當中,發現了這樣的問題:this is incompatible with sql_mode=only_full_group_by。

在把服務從 AWS 搬到 GCP 的過程當中,發現了這樣的問題:this is incompatible with sql_mode=only_full_group_by。

查了一下才發現,原來從 MySQL 5.7 開始,sql_mode 預設會是 only_full_group_by 的設定。

而我目前在 AWS 上面的服務,因為也跑了有兩年之久,所以還停留在 MySQL 5.6 的版本,而 MySQL 5.6 並沒有將 only_full_group_by 作為預設。

根本的解決之道,是把這段不是太好的 SQL 給修好。

但眼前服務要能夠先完成移轉驗證,只好先在 GCP 上面做一些偷吃步的設定了:

進入到你的 Cloud SQL instance,選擇 Edit 後,在 database flags 的區段裡面增加 key 是 sql_mode、value 是 TRADITIONAL 的設定。

然後重新啟動 instance 即可。

 

markkwsu

markkwsu

Add comment

Highlight option

Turn on the "highlight" option for any widget, to get an alternative styling like this. You can change the colors for highlighted widgets in the theme options. See more examples below.

Instagram

Instagram has returned empty data. Please authorize your Instagram account in the plugin settings .

Categories count color

Advertisement

Small ads

Flickr

  • table
  • l'échappée
  • balkon
  • impro
  • Carlotta
  • Stiefel
  • en fleurs
  • les anti-s'assoir
  • boutons

Social Widget

Collaboratively harness market-driven processes whereas resource-leveling internal or "organic" sources.

ThemeForest