Skip to content

Instantly share code, notes, and snippets.

@novaDev315
Last active February 18, 2020 20:42
Show Gist options
  • Select an option

  • Save novaDev315/885ad70264fcb5a4819d89ddb0edb1a2 to your computer and use it in GitHub Desktop.

Select an option

Save novaDev315/885ad70264fcb5a4819d89ddb0edb1a2 to your computer and use it in GitHub Desktop.

Revisions

  1. novaDev315 revised this gist Feb 18, 2020. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion db help query .sql
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    /* fix nodejs app connection mysql */
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
    flush privileges;
    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;
  2. novaDev315 created this gist Feb 13, 2020.
    3 changes: 3 additions & 0 deletions db help query .sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    /* fix nodejs app connection mysql */
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
    flush privileges;