Recent notes

Related tags

  mysql2

  mysql

2 months ago
#Rails #mysql2 gem compatibility

  • mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher.
  • mysql2 0.3.x works with Rails / Active Record 3.1, 3.2, 4.x, 5.0.
  • mysql2 0.2.x works with Rails / Active Record 2.3 - 3.0.
3 months ago
Full unicode support in #mysql 

For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Database config in #rails

production:
  # ...
  encoding: utf8mb4
  collation: utf8mb4_bin