Last active
February 18, 2020 20:42
-
-
Save novaDev315/885ad70264fcb5a4819d89ddb0edb1a2 to your computer and use it in GitHub Desktop.
SQL helper query script
This file contains hidden or 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
/* fix nodejs app connection mysql */ | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; | |
flush privileges; | |
/*** change database and table character encode ***/ | |
/* for MySQL 5.5.3 abd newer version */ | |
ALTER DATABASE databasename CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
/* for MySQL 5.5.2 or older which didn't support 4-byte UTF-8 */ | |
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment