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.

135 lines
3.8 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. # Be aware that this log type is a performance killer.
  52. # As of 5.1 you can enable the log at runtime!
  53. #general_log_file = /var/log/mysql/mysql.log
  54. #general_log = 1
  55. #
  56. # Error log - should be very few entries.
  57. # Note that if unset the errors will go to stdout and can be seen in syslog
  58. # (check "logread")
  59. #
  60. #log_error = /var/log/mysql/error.log
  61. #
  62. # Enable the slow query log to see queries with especially long duration
  63. #slow_query_log_file = /var/log/mysql/mariadb-slow.log
  64. #long_query_time = 10
  65. #log_slow_rate_limit = 1000
  66. #log_slow_verbosity = query_plan
  67. #
  68. #log-queries-not-using-indexes
  69. #
  70. # The following can be used as easy to replay backup logs or for replication.
  71. #server-id = 1
  72. #log_bin = /var/log/mysql/mysql-bin.log
  73. expire_logs_days = 10
  74. max_binlog_size = 100M
  75. #binlog_do_db = include_database_name
  76. #binlog_ignore_db = exclude_database_name
  77. #
  78. # * InnoDB
  79. #
  80. # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
  81. # Read the manual for more InnoDB related options. There are many!
  82. #
  83. # * Security Features
  84. #
  85. # Read the manual, too, if you want chroot!
  86. # chroot = /var/lib/mysql/
  87. #
  88. # For generating SSL certificates you can use for example the GUI tool "tinyca".
  89. #
  90. # ssl-ca=/etc/mysql/cacert.pem
  91. # ssl-cert=/etc/mysql/server-cert.pem
  92. # ssl-key=/etc/mysql/server-key.pem
  93. #
  94. # Accept only connections using the latest and most secure TLS protocol version.
  95. # ..when MariaDB is compiled with OpenSSL:
  96. # ssl-cipher=TLSv1.2
  97. #
  98. # * Character sets
  99. #
  100. # MySQL/MariaDB default is Latin1, but in OpenWrt we rather default to the full
  101. # utf8 4-byte character set. See also client.cnf
  102. #
  103. # Note: In OpenWrt until mariadb 10.2.19-2 the baked-in defaults were
  104. # "DEFAULT_CHARSET=utf8" and "DEFAULT_COLLATION=utf8_general_ci". As MariaDB's
  105. # utf8 (supports three bytes per character) is not really UTF-8 (which needs up
  106. # to four bytes per character) this was changed. Now the baked in-defaults are
  107. # the upstream defaults (Latin1), but in the default configuration (like in the
  108. # file you are currently reading) utf8mb4 is set, which is real UTF-8.
  109. #
  110. # Of course you are free to change this, either here or in a configuration file
  111. # of your own which is read after this .cnf file, see my.cnf in parent folder
  112. # (files are read in alphabetical order).
  113. character-set-server = utf8mb4
  114. collation-server = utf8mb4_general_ci
  115. #
  116. # * Unix socket authentication plugin is built-in
  117. #
  118. # Needed so the root database user can authenticate without a password but
  119. # only when running as the unix root user.
  120. #
  121. # Also available for other users if required.
  122. # See https://mariadb.com/kb/en/unix_socket-authentication-plugin/