Created
July 30, 2020 17:38
-
-
Save Arxero/a6ec6d6345a1b3422014d1e3a83f1a1b to your computer and use it in GitHub Desktop.
FIX for Error Code: 1366. Incorrect string value: '\xF0\x9F\x98\x98' for column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Info > https://stackoverflow.com/questions/8906813/how-to-change-the-default-charset-of-a-mysql-table | |
SELECT * FROM `gw-local-2`.posts; | |
SET character_set_system = utf8mb4; | |
UPDATE `gw-local-2`.posts SET content = '😘 asd' where id='9552a88e-cd97-4130-8daa-d0bb48977ebc'; | |
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; | |
/* The actual fix */ | |
ALTER TABLE `gw-local-2`.posts | |
CHANGE COLUMN content content varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment