Index: mysql-test/r/connect.result =================================================================== --- mysql-test/r/connect.result (revision 5664) +++ mysql-test/r/connect.result (working copy) @@ -416,3 +416,14 @@ # ------------------------------------------------------------------ # -- End of 5.6 tests # ------------------------------------------------------------------ +# +# Test option --skip-insecure-warning +# +GRANT ALL ON *.* TO 'siw'@'%' IDENTIFIED BY 'siw'; +FLUSH PRIVILEGES; +Warning: Using a password on the command line interface can be insecure. +USER() +siw@localhost +USER() +siw@localhost +DROP USER siw; Index: mysql-test/t/connect.test =================================================================== --- mysql-test/t/connect.test (revision 5664) +++ mysql-test/t/connect.test (working copy) @@ -502,12 +502,20 @@ DROP USER wl6587@localhost; - --echo # ------------------------------------------------------------------ --echo # -- End of 5.6 tests --echo # ------------------------------------------------------------------ +--echo # +--echo # Test option --skip-insecure-warning +--echo # +GRANT ALL ON *.* TO 'siw'@'%' IDENTIFIED BY 'siw'; +FLUSH PRIVILEGES; +--exec $MYSQL -usiw --password=siw test -e "SELECT USER()" 2>&1 +--exec $MYSQL -usiw --password=siw --skip-insecure-warning test -e "SELECT USER()" 2>&1 + +DROP USER siw; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc Index: mysys_ssl/my_getopt.cc =================================================================== --- mysys_ssl/my_getopt.cc (revision 5664) +++ mysys_ssl/my_getopt.cc (working copy) @@ -235,12 +235,14 @@ Search for args_separator, if found, then the first part of the arguments are loaded from configs */ + char *skip_check_pos= NULL; for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++) { /*Check if skip-insecure-warning was specified*/ if (*pos && (strcmp(*pos, "--skip-insecure-warning") == 0)) { + skip_check_pos= *pos; opt_skip_insecure_warn= true; if (!is_cmdline_arg) break; @@ -257,6 +259,14 @@ char **first= pos; char *cur_arg= *pos; opt_found= 0; + + /*silently ignore --skip-insecure-warning */ + if (skip_check_pos && (cur_arg == skip_check_pos)) + { + (*argc)--; + continue; + } + if (!is_cmdline_arg && (my_getopt_is_args_separator(cur_arg))) { is_cmdline_arg= 1; Index: client/mysql.cc =================================================================== --- client/mysql.cc (revision 5664) +++ client/mysql.cc (working copy) @@ -1775,7 +1775,8 @@ "password sandbox mode.", &opt_connect_expired_password, &opt_connect_expired_password, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-insecure-warning", 0, "Don pint warning if passowrd wasspecified.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip-insecure-warning", 0, "Don't print warning if password was specified.", + 0, 0, 0, GET_NO_ARG, 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} };