mysql_master.cnf 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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-do-db = buyao
  19. binlog-ignore-db = mysql
  20. binlog-ignore-db = information_schema
  21. binlog-ignore-db = performance_schema
  22. binlog-ignore-db = sys
  23. expire_logs_days=7
  24. binlog_format=ROW
  25. max_binlog_size=100M
  26. binlog_cache_size=16M
  27. max_binlog_cache_size=256M
  28. relay_log_recovery=1
  29. sync_binlog=1
  30. server-id=1
  31. #
  32. # Remove leading # to set options mainly useful for reporting servers.
  33. # The server defaults are faster for transactions and fast SELECTs.
  34. # Adjust sizes as needed, experiment to find the optimal values.
  35. # join_buffer_size = 128M
  36. # sort_buffer_size = 2M
  37. # read_rnd_buffer_size = 2M
  38. datadir=/var/lib/mysql
  39. socket=/var/lib/mysql/mysql.sock
  40. # Disabling symbolic-links is recommended to prevent assorted security risks
  41. symbolic-links=0
  42. log-error=/var/log/mysqld.log
  43. pid-file=/var/run/mysqld/mysqld.pid
  44. # time zone
  45. log_timestamps=SYSTEM
  46. # PASSWORD POLICY
  47. character-set-server = utf8mb4
  48. collation-server = utf8mb4_unicode_ci
  49. init_connect='SET NAMES utf8mb4'
  50. table_open_cache = 256
  51. query_cache_size = 2M
  52. tmp_table_size = 32M
  53. thread_cache_size = 8
  54. max_connections=1000
  55. sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  56. # INNODB #
  57. innodb-flush-method = O_DIRECT
  58. innodb-log-files-in-group = 2
  59. innodb-log-file-size = 128M
  60. innodb-flush-log-at-trx-commit = 2
  61. innodb-file-per-table = 1
  62. innodb-buffer-pool-size = 4G
  63. # SLOW-LOG #
  64. slow_query_log=ON
  65. slow_query_log_file=/srv/mysql/mysql-slow.log
  66. long_query_time=2
  67. log_queries_not_using_indexes=0
  68. [client]
  69. port=3306
  70. default-character-set=utf8mb4