Skip to content

Instantly share code, notes, and snippets.

@aminkhoshzahmat
Last active January 30, 2021 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminkhoshzahmat/b79ec646b844b6a0492bb5ed244983cd to your computer and use it in GitHub Desktop.
Save aminkhoshzahmat/b79ec646b844b6a0492bb5ed244983cd to your computer and use it in GitHub Desktop.
Convert collation
UPDATE company
SET name=convert(cast(convert(name using latin1) as binary) using utf8mb4),
contact_role=convert(cast(convert(contact_role using latin1) as binary) using utf8mb4),
address=convert(cast(convert(address using latin1) as binary) using utf8mb4),
city=convert(cast(convert(city using latin1) as binary) using utf8mb4),
phone=convert(cast(convert(phone using latin1) as binary) using utf8mb4),
postal_code=convert(cast(convert(postal_code using latin1) as binary) using utf8mb4),
website=convert(cast(convert(website using latin1) as binary) using utf8mb4),
code=convert(cast(convert(code using latin1) as binary) using utf8mb4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment