mysql_master.cnf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # For advice on how to change settings please see
  2. # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
  3. [mysql]
  4. # CLIENT #
  5. port = 3306
  6. socket =/var/lib/mysql/mysql.sock
  7. default-character-set = utf8mb4
  8. [mysqld]
  9. #
  10. # Remove leading # and set to the amount of RAM for the most important data
  11. # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  12. # innodb_buffer_pool_size = 128M
  13. #
  14. # Remove leading # to turn on a very important data integrity option: logging
  15. # changes to the binary log between backups.
  16. log_bin=binlog
  17. binlog-do-db = test
  18. binlog-ignore-db = mysql
  19. binlog-ignore-db = information_schema
  20. binlog-ignore-db = performance_schema
  21. binlog-ignore-db = sys
  22. expire_logs_days=7
  23. binlog_format=ROW
  24. max_binlog_size=100M
  25. binlog_cache_size=16M
  26. max_binlog_cache_size=256M
  27. relay_log_recovery=1
  28. sync_binlog=1
  29. server-id=1
  30. #
  31. # Remove leading # to set options mainly useful for reporting servers.
  32. # The server defaults are faster for transactions and fast SELECTs.
  33. # Adjust sizes as needed, experiment to find the optimal values.
  34. # join_buffer_size = 128M
  35. # sort_buffer_size = 2M
  36. # read_rnd_buffer_size = 2M
  37. datadir=/var/lib/mysql
  38. socket=/var/lib/mysql/mysql.sock
  39. # Disabling symbolic-links is recommended to prevent assorted security risks
  40. symbolic-links=0
  41. log-error=/var/log/mysqld.log
  42. pid-file=/var/run/mysqld/mysqld.pid
  43. # time zone
  44. log_timestamps=SYSTEM
  45. # PASSWORD POLICY
  46. character-set-server = utf8mb4
  47. collation-server = utf8mb4_unicode_ci
  48. init_connect='SET NAMES utf8mb4'
  49. table_open_cache = 256
  50. query_cache_size = 2M
  51. tmp_table_size = 32M
  52. thread_cache_size = 8
  53. max_connections=1000
  54. sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  55. # INNODB #
  56. innodb-flush-method = O_DIRECT
  57. innodb-log-files-in-group = 2
  58. innodb-log-file-size = 128M
  59. innodb-flush-log-at-trx-commit = 2
  60. innodb-file-per-table = 1
  61. innodb-buffer-pool-size = 4G
  62. # SLOW-LOG #
  63. slow_query_log=ON
  64. slow_query_log_file=/srv/mysql/mysql-slow.log
  65. long_query_time=2
  66. log_queries_not_using_indexes=0
  67. [client]
  68. port=3306
  69. default-character-set=utf8mb4