You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
3.9 KiB

mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
  1. #
  2. # These groups are read by MariaDB server.
  3. # Use it for options that only the server (but not clients) should see
  4. #
  5. # See the examples of server my.cnf files in /usr/share/mysql/
  6. #
  7. # this is read by the standalone daemon and embedded servers
  8. [server]
  9. # this is only for the mysqld standalone daemon
  10. [mysqld]
  11. #
  12. # * Basic Settings
  13. #
  14. user = mariadb
  15. pid-file = /var/run/mysqld/mysqld.pid
  16. socket = /var/run/mysqld/mysqld.sock
  17. port = 3306
  18. basedir = /usr
  19. # Don't put this on flash memory
  20. # Figure out where you are going to put the databases and run
  21. # mysql_install_db --force
  22. datadir = /mnt/data/mysql
  23. # tmpdir should also not go on flash memory
  24. tmpdir = /tmp
  25. lc-messages-dir = /usr/share/mariadb
  26. skip-external-locking
  27. # Instead of skip-networking the default is now to listen only on
  28. # localhost which is more compatible and is not less secure.
  29. bind-address = 127.0.0.1
  30. #
  31. # * Fine Tuning
  32. #
  33. key_buffer_size = 16M
  34. max_allowed_packet = 16M
  35. thread_stack = 192K
  36. thread_cache_size = 8
  37. # This replaces the startup script and checks MyISAM tables if needed
  38. # the first time they are touched
  39. myisam_recover_options = BACKUP
  40. #max_connections = 100
  41. #table_cache = 64
  42. #thread_concurrency = 10
  43. #
  44. # * Query Cache Configuration
  45. #
  46. query_cache_limit = 1M
  47. query_cache_size = 16M
  48. #
  49. # * Logging and Replication
  50. #
  51. # Both location gets rotated by the cronjob.
  52. # Be aware that this log type is a performance killer.
  53. # As of 5.1 you can enable the log at runtime!
  54. #general_log_file = /var/log/mysql/mysql.log
  55. #general_log = 1
  56. #
  57. # Error log - should be very few entries.
  58. # Note that if unset the errors will go to stdout and can be seen in syslog
  59. # (check "logread")
  60. #
  61. #log_error = /var/log/mysql/error.log
  62. #
  63. # Enable the slow query log to see queries with especially long duration
  64. #slow_query_log_file = /var/log/mysql/mariadb-slow.log
  65. #long_query_time = 10
  66. #log_slow_rate_limit = 1000
  67. #log_slow_verbosity = query_plan
  68. #
  69. #log-queries-not-using-indexes
  70. #
  71. # The following can be used as easy to replay backup logs or for replication.
  72. #server-id = 1
  73. #log_bin = /var/log/mysql/mysql-bin.log
  74. expire_logs_days = 10
  75. max_binlog_size = 100M
  76. #binlog_do_db = include_database_name
  77. #binlog_ignore_db = exclude_database_name
  78. #
  79. # * InnoDB
  80. #
  81. # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
  82. # Read the manual for more InnoDB related options. There are many!
  83. #
  84. # * Security Features
  85. #
  86. # Read the manual, too, if you want chroot!
  87. # chroot = /var/lib/mysql/
  88. #
  89. # For generating SSL certificates you can use for example the GUI tool "tinyca".
  90. #
  91. # ssl-ca=/etc/mysql/cacert.pem
  92. # ssl-cert=/etc/mysql/server-cert.pem
  93. # ssl-key=/etc/mysql/server-key.pem
  94. #
  95. # Accept only connections using the latest and most secure TLS protocol version.
  96. # ..when MariaDB is compiled with OpenSSL:
  97. # ssl-cipher=TLSv1.2
  98. #
  99. # * Character sets
  100. #
  101. # MySQL/MariaDB default is Latin1, but in OpenWrt we rather default to the full
  102. # utf8 4-byte character set. See also client.cnf
  103. #
  104. # Note: In OpenWrt until mariadb 10.2.19-2 the baked-in defaults were
  105. # "DEFAULT_CHARSET=utf8" and "DEFAULT_COLLATION=utf8_general_ci". As MariaDB's
  106. # utf8 (supports three bytes per character) is not really UTF-8 (which needs up
  107. # to four bytes per character) this was changed. Now the baked in-defaults are
  108. # the upstream defaults (Latin1), but in the default configuration (like in the
  109. # file you are currently reading) utf8mb4 is set, which is real UTF-8.
  110. #
  111. # Of course you are free to change this, either here or in a configuration file
  112. # of your own which is read after this .cnf file, see my.cnf in parent folder
  113. # (files are read in alphabetical order).
  114. character-set-server = utf8mb4
  115. collation-server = utf8mb4_general_ci
  116. #
  117. # * Unix socket authentication plugin is built-in
  118. #
  119. # Needed so the root database user can authenticate without a password but
  120. # only when running as the unix root user.
  121. #
  122. # Also available for other users if required.
  123. # See https://mariadb.com/kb/en/unix_socket-authentication-plugin/