summaryrefslogtreecommitdiff
path: root/databases/mysql56-server/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mysql56-server/files')
-rw-r--r--databases/mysql56-server/files/my.cnf.sample.in63
-rw-r--r--databases/mysql56-server/files/mysql-server.in30
-rw-r--r--databases/mysql56-server/files/patch-mysys_ssl_my_default.cc50
3 files changed, 127 insertions, 16 deletions
diff --git a/databases/mysql56-server/files/my.cnf.sample.in b/databases/mysql56-server/files/my.cnf.sample.in
new file mode 100644
index 000000000000..a7b7a804bc34
--- /dev/null
+++ b/databases/mysql56-server/files/my.cnf.sample.in
@@ -0,0 +1,63 @@
+# $FreeBSD$
+
+[client]
+port = 3306
+socket = /tmp/mysql.sock
+
+[mysql]
+prompt = \u@\h [\d]>\_
+no_auto_rehash
+
+[mysqld]
+user = mysql
+port = 3306
+socket = /tmp/mysql.sock
+bind-address = 127.0.0.1
+basedir = %%PREFIX%%
+datadir = %%MY_DBDIR%%
+tmpdir = %%MY_TMPDIR%%
+slave-load-tmpdir = %%MY_TMPDIR%%
+secure-file-priv = %%MY_SECDIR%%
+log-bin = mysql-bin
+log-output = TABLE
+master-info-repository = TABLE
+relay-log-info-repository = TABLE
+relay-log-recovery = 1
+slow-query-log = 1
+server-id = 1
+sync_binlog = 1
+sync_relay_log = 1
+binlog_cache_size = 16M
+expire_logs_days = 30
+log-slave-updates = 1
+enforce-gtid-consistency = 1
+gtid-mode = ON
+safe-user-create = 1
+lower_case_table_names = 1
+explicit-defaults-for-timestamp = 1
+myisam-recover-options = BACKUP,FORCE
+open_files_limit = 32768
+table_open_cache = 16384
+table_definition_cache = 8192
+net_retry_count = 16384
+key_buffer_size = 256M
+max_allowed_packet = 64M
+query_cache_type = 0
+query_cache_size = 0
+long_query_time = 0.5
+innodb_buffer_pool_size = 1G
+innodb_data_home_dir = %%MY_DBDIR%%
+innodb_log_group_home_dir = %%MY_DBDIR%%
+innodb_data_file_path = ibdata1:128M:autoextend
+innodb_flush_method = O_DIRECT
+innodb_log_file_size = 256M
+innodb_log_buffer_size = 16M
+innodb_write_io_threads = 8
+innodb_read_io_threads = 8
+innodb_autoinc_lock_mode = 2
+skip-symbolic-links
+
+[mysqldump]
+max_allowed_packet = 256M
+quote_names
+quick
diff --git a/databases/mysql56-server/files/mysql-server.in b/databases/mysql56-server/files/mysql-server.in
index b5015e5505f3..a3041e6478ce 100644
--- a/databases/mysql56-server/files/mysql-server.in
+++ b/databases/mysql56-server/files/mysql-server.in
@@ -14,10 +14,12 @@
# mysql_limits (bool): Set to "NO" by default.
# Set it to yes to run `limits -e -U mysql`
# just before mysql starts.
-# mysql_dbdir (str): Default to "/var/db/mysql"
+# mysql_dbdir (str): Default to "%%MY_DBDIR%%"
# Base database directory.
+# mysql_confdir (str): Default to "%%ETCDIR%%"
+# Base configuration directory.
# mysql_optfile (str): Server-specific option file.
-# Default to "${mysql_dbdir}/my.cnf".
+# Default to "${mysql_confdir}/my.cnf".
# mysql_pidfile (str): Custum PID file path and name.
# Default to "${mysql_dbdir}/${hostname}.pid".
# mysql_args (str): Custom additional arguments to be passed
@@ -33,20 +35,25 @@ load_rc_config $name
: ${mysql_enable="NO"}
: ${mysql_limits="NO"}
-: ${mysql_dbdir="/var/db/mysql"}
+: ${mysql_dbdir="%%MY_DBDIR%%"}
+: ${mysql_confdir="%%ETCDIR%%"}
+if [ -f "${mysql_dbdir}/my.cnf" ]; then
: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
+else
+: ${mysql_optfile="${mysql_confdir}/my.cnf"}
+fi
mysql_user="mysql"
mysql_limits_args="-e -U ${mysql_user}"
: ${hostname:=`/bin/hostname`}
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"}
command="/usr/sbin/daemon"
-command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
+command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --pid-file=${pidfile} --user=${mysql_user} ${mysql_args} %%PERFSCHEMRC%%"
procname="%%PREFIX%%/libexec/mysqld"
start_precmd="${name}_prestart"
start_postcmd="${name}_poststart"
mysql_install_db="%%PREFIX%%/bin/mysql_install_db"
-mysql_install_db_args="--basedir=%%PREFIX%% --defaults-extra-file=${mysql_optfile} --datadir=${mysql_dbdir} --force"
+mysql_install_db_args="--defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --user=${mysql_user} --force"
mysql_create_auth_tables()
{
@@ -56,7 +63,18 @@ mysql_create_auth_tables()
mysql_prestart()
{
- if [ ! -d "${mysql_dbdir}/mysql/." ]; then
+ if [ -f "${mysql_dbdir}/my.cnf" ]; then
+ echo ""
+ echo "Please keep in mind that the default location for my.cnf has changed"
+ echo "from \"%%MY_DBDIR%%/my.cnf\" to \"%%ETCDIR%%/my.cnf\". "
+ echo "Please merge your existing my.cnf with the new default and move"
+ echo "it to \"%%ETCDIR%%/my.cnf\"."
+ echo "If you do not want to move your my.cnf to the new location then"
+ echo "you must set \"mysql_optfile\" in /etc/rc.conf to \"/var/db/mysql/my.cnf\"."
+ echo ""
+ fi
+
+ if [ ! -d "${mysql_dbdir}/mysql" ]; then
mysql_create_auth_tables || return 1
fi
if checkyesno mysql_limits; then
diff --git a/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc b/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
index f6f38decb8ec..fa06468ce959 100644
--- a/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
+++ b/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
@@ -1,6 +1,6 @@
---- mysys_ssl/my_default.cc.orig 2013-01-22 17:54:49.000000000 +0100
-+++ mysys_ssl/my_default.cc 2013-02-13 11:08:15.000000000 +0100
-@@ -119,7 +119,7 @@
+--- mysys_ssl/my_default.cc.orig 2016-11-28 13:36:22 UTC
++++ mysys_ssl/my_default.cc
+@@ -110,7 +110,7 @@ static my_bool defaults_already_read= FA
/* Which directories are searched for options (and in which order) */
@@ -9,18 +9,48 @@
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */
static const char **default_directories = NULL;
-@@ -1395,7 +1395,10 @@
+@@ -903,6 +903,14 @@ static int search_default_file_with_ext(
+ return 1; /* Ignore wrong files */
+ }
- #if defined(DEFAULT_SYSCONFDIR)
- if (DEFAULT_SYSCONFDIR[0])
++ if (strstr(name, "/etc") == name)
+ {
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
++ fprintf(stderr,
++ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n",
++ name,name);
++ goto err;
+ }
- #endif /* DEFAULT_SYSCONFDIR */
++
+ while (mysql_file_getline(buff, sizeof(buff) - 1, fp, is_login_file))
+ {
+ line++;
+@@ -1241,7 +1249,8 @@ void my_print_default_files(const char *
+ end[(strlen(end)-1)] = ' ';
+ else
+ strxmov(end, conf_file, *ext , " ", NullS);
+- fputs(name, stdout);
++ if (strstr(name, "/etc") != name)
++ fputs(name, stdout);
+ }
+ }
+ }
+@@ -1400,13 +1409,8 @@ static const char **init_default_directo
+
+ #else
+
+- errors += add_directory(alloc, "/etc/", dirs);
+- errors += add_directory(alloc, "/etc/mysql/", dirs);
+-
+-#if defined(DEFAULT_SYSCONFDIR)
+- if (DEFAULT_SYSCONFDIR[0])
+- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+-#endif /* DEFAULT_SYSCONFDIR */
++ errors += add_directory(alloc, "/usr/local/etc/", dirs);
++ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs);
#endif
-@@ -1466,7 +1469,7 @@
+
+@@ -1477,7 +1481,7 @@ int check_file_permissions(const char *f
MY_STAT stat_info;
if (!my_stat(file_name,&stat_info,MYF(0)))