@@ -373,6 +373,7 @@ my_bool opt_noversioncheck = FALSE;
373
373
my_bool opt_decompress = FALSE ;
374
374
my_bool opt_remove_original;
375
375
my_bool opt_log_innodb_page_corruption;
376
+ my_bool tty_password= FALSE ;
376
377
377
378
my_bool opt_lock_ddl_per_table = FALSE ;
378
379
static my_bool opt_check_privileges;
@@ -1655,7 +1656,7 @@ struct my_option xb_client_options[]= {
1655
1656
" This option specifies the password to use "
1656
1657
" when connecting to the database. It accepts a string argument. "
1657
1658
" See mysql --help for details." ,
1658
- 0 , 0 , 0 , GET_STR, REQUIRED_ARG , 0 , 0 , 0 , 0 , 0 , 0 },
1659
+ 0 , 0 , 0 , GET_STR, OPT_ARG , 0 , 0 , 0 , 0 , 0 , 0 },
1659
1660
1660
1661
{" protocol" , OPT_PROTOCOL,
1661
1662
" The protocol to use for connection (tcp, socket, pipe, memory)." , 0 , 0 ,
@@ -2333,6 +2334,7 @@ xb_get_one_option(const struct my_option *opt,
2333
2334
break ;
2334
2335
case ' p' :
2335
2336
opt_password = argument;
2337
+ tty_password = argument == NULL ;
2336
2338
break ;
2337
2339
case OPT_PROTOCOL:
2338
2340
if (argument)
@@ -7332,6 +7334,8 @@ void handle_options(int argc, char **argv, char ***argv_server,
7332
7334
if (*start)
7333
7335
start[1 ]= 0 ;
7334
7336
}
7337
+ else if (tty_password)
7338
+ opt_password= my_get_tty_password (NullS);
7335
7339
7336
7340
/* 4) Process --mysqld-args options, ignore unknown options */
7337
7341
0 commit comments