diff options
-rw-r--r-- | sql/mysqld.cc | 37 | ||||
-rw-r--r-- | support-files/my-huge.cnf.sh | 4 | ||||
-rw-r--r-- | support-files/my-innodb-heavy-4G.cnf.sh | 2 | ||||
-rw-r--r-- | support-files/my-large.cnf.sh | 4 | ||||
-rw-r--r-- | support-files/my-medium.cnf.sh | 4 | ||||
-rw-r--r-- | support-files/my-small.cnf.sh | 2 |
6 files changed, 39 insertions, 14 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index dd7fd98158a..72b02b76ddf 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2681,6 +2681,20 @@ with --log-bin instead."); if (opt_bin_log) { + if (!opt_bin_logname && !opt_binlog_index_name) + { + /* + User didn't give us info to name the binlog index file. + Picking `hostname`-bin.index like did in 4.x, causes replication to + fail if the hostname is changed later. So, we would like to instead + require a name. But as we don't want to break many existing setups, we + only give warning, not error. + */ + sql_print_warning("\ +No argument was provided to --log-bin, and --log-bin-index was not used. " +"Replication may break when this MySQL server acts as a master and has his " +"hostname changed."); + } /* If we fail to open binlog, it's going to hinder our recovery, so die */ if (open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size)) @@ -2695,11 +2709,20 @@ with --log-bin instead."); } #endif } - else if (opt_log_slave_updates) + else { - sql_print_warning("\ -you need to use --log-bin to make --log-slave-updates work. \ -Now disabling --log-slave-updates."); + if (opt_log_slave_updates) + { + sql_print_error("\ +You need to use --log-bin=# to make --log-slave-updates work."); + unireg_abort(1); + } + if (opt_binlog_index_name) + { + sql_print_error("\ +You need to use --log-bin=# to make --log-bin-index work."); + unireg_abort(1); + } } #ifdef HAVE_REPLICATION @@ -4493,14 +4516,16 @@ Disable with --skip-isam.", {"log", 'l', "Log connections and queries to file.", (gptr*) &opt_logname, (gptr*) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin", OPT_BIN_LOG, - "Log update queries in binary format.", + "Log update queries in binary format. Optional (but strongly recommended " + "to avoid replication problems if server's hostname changes) argument " + "should be the chosen location for the binary log files.", (gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin-index", OPT_BIN_LOG_INDEX, "File that holds the names for last binary log files.", (gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"log-error", OPT_ERROR_LOG_FILE, "Log error file.", + {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", (gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.", diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index d25686f1c21..f7a47054658 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -48,7 +48,7 @@ thread_concurrency = 8 # Replication Master Server (default) # binary logging is required for replication -log-bin +log-bin=mysql-bin # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set @@ -108,7 +108,7 @@ server-id = 1 #master-port = <port> # # binary logging - not required for slaves, but recommended -#log-bin +#log-bin=mysql-bin # Point the following paths to different dedicated disks #tmpdir = /tmp/ diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 062d106ce6a..b3f43272a7d 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -189,7 +189,7 @@ tmp_table_size = 64M # Enable binary logging. This is required for acting as a MASTER in a # replication configuration. You also need the binary log if you need # the ability to do point in time recovery from your latest backup. -log_bin +log-bin=mysql-bin # If you're using replication with chained slaves (A->B->C), you need to # enable this option on server B. It enables logging of updates done by diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index 59aca4b32f2..1e7d9f7aade 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -48,7 +48,7 @@ thread_concurrency = 8 # Replication Master Server (default) # binary logging is required for replication -log-bin +log-bin=mysql-bin # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set @@ -108,7 +108,7 @@ server-id = 1 #master-port = <port> # # binary logging - not required for slaves, but recommended -#log-bin +#log-bin=mysql-bin # Point the following paths to different dedicated disks #tmpdir = /tmp/ diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index 529740d59f0..99b6e823f39 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -46,7 +46,7 @@ myisam_sort_buffer_size = 8M # Replication Master Server (default) # binary logging is required for replication -log-bin +log-bin=mysql-bin # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set @@ -106,7 +106,7 @@ server-id = 1 #master-port = <port> # # binary logging - not required for slaves, but recommended -#log-bin +#log-bin=mysql-bin # Point the following paths to different dedicated disks #tmpdir = /tmp/ diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index b2ecca6127e..288df893b4c 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -46,7 +46,7 @@ thread_stack = 64K server-id = 1 # Uncomment the following if you want to log updates -#log-bin +#log-bin=mysql-bin # Uncomment the following if you are NOT using BDB tables #skip-bdb |