@@ -373,6 +373,7 @@ my_bool opt_noversioncheck = FALSE;
373373my_bool opt_decompress = FALSE ;
374374my_bool opt_remove_original;
375375my_bool opt_log_innodb_page_corruption;
376+ my_bool tty_password= FALSE ;
376377
377378my_bool opt_lock_ddl_per_table = FALSE ;
378379static my_bool opt_check_privileges;
@@ -1655,7 +1656,7 @@ struct my_option xb_client_options[]= {
16551656 " This option specifies the password to use "
16561657 " when connecting to the database. It accepts a string argument. "
16571658 " 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 },
16591660
16601661 {" protocol" , OPT_PROTOCOL,
16611662 " 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,
23332334 break ;
23342335 case ' p' :
23352336 opt_password = argument;
2337+ tty_password = argument == NULL ;
23362338 break ;
23372339 case OPT_PROTOCOL:
23382340 if (argument)
@@ -7332,6 +7334,8 @@ void handle_options(int argc, char **argv, char ***argv_server,
73327334 if (*start)
73337335 start[1 ]= 0 ;
73347336 }
7337+ else if (tty_password)
7338+ opt_password= my_get_tty_password (NullS);
73357339
73367340 /* 4) Process --mysqld-args options, ignore unknown options */
73377341
0 commit comments