Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created December 26, 2013 10:28
Show Gist options
  • Save yoku0825/8132046 to your computer and use it in GitHub Desktop.
Save yoku0825/8132046 to your computer and use it in GitHub Desktop.
Add --secure-auth parameter like mysql command-line client.
*** client/mysqlbinlog.cc.org 2013-11-18 03:02:54.000000000 +0900
--- client/mysqlbinlog.cc 2013-12-26 19:27:05.618812123 +0900
***************
*** 158,163 ****
--- 158,164 ----
Checkable_rwlock *global_sid_lock= NULL;
Gtid_set *gtid_set_included= NULL;
Gtid_set *gtid_set_excluded= NULL;
+ my_bool opt_secure_auth= FALSE;
/**
***************
*** 1584,1589 ****
--- 1585,1595 ----
"Identifiers were provided.",
&opt_exclude_gtids_str, &opt_exclude_gtids_str, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"secure-auth", OPT_SECURE_AUTH,
+ "Refuse client connecting to server if it"
+ " uses old (pre-4.1.1) protocol.",
+ &opt_secure_auth, &opt_secure_auth, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
***************
*** 1841,1846 ****
--- 1847,1853 ----
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"program_name", "mysqlbinlog");
+ mysql_options(mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
if (!mysql_real_connect(mysql, host, user, pass, 0, port, sock, 0))
{
error("Failed on connect: %s", mysql_error(mysql));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment