Recent notes

Related tags

  performance

  rails

7 months ago
Reduce your server's resource usage by moving #MySQL temporary directory to tmpfs for better #performance

https://2bits.com/articles/reduce-your-servers-resource-usage-moving-mysql-temporary-directory-ram-disk.html


8 months ago
Create new user in #mysql and grant privileges

> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

> CREATE DATABASE IF NOT EXISTS db_name;

> GRANT ALL PRIVILEGES ON db_name.* TO 'username'@'localhost' IDENTIFIED BY 'password';
9 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