无法从 linux xshell 直接插入 mysql 数据库

Unable to direct insert in mysql database from linux xshell

我有 运行 下面的命令将数据插入我的 mysql 数据库。 sql查询正常。但是在 运行 查询之后,会提示输入密码。但在我的数据库中没有设置密码。所以,如果我不写任何东西就按回车键,那么它就是在插入数据。我怎样才能避免这个提示。这意味着我希望该命令可以直接运行。不会提示输入密码。

Enter password: 
linux-pott:/opt/lampp/htdocs # mysql -uroot -p  -e 'insert into dialer_rate(date_time,time,mno,trx_type,trx_result,trx_value) values("2015-02-19","12:14","air","N/A","Not_Running",0) ' bkash
Enter password: 
linux-pott:/opt/lampp/htdocs # 

删除命令中的选项-p

linux-pott:/opt/lampp/htdocs # mysql -u root -e 'insert into dialer_rate(date_time,time,mno,trx_type,trx_result,trx_value) values("2015-02-19","12:14","air","N/A","Not_Running",0) ' bkash

来自官方documentation:

For a long option that takes a value, separate the option name and the value by an “=” sign. For a short option that takes a value, the option value can immediately follow the option letter, or there can be a space between: -hlocalhost and -h localhost are equivalent. An exception to this rule is the option for specifying your MySQL password. This option can be given in long form as --password=pass_val or as --password. In the latter case (with no password value given), the program prompts you for the password. The password option also may be given in short form as -ppass_val or as -p. However, for the short form, if the password value is given, it must follow the option letter with no intervening space. The reason for this is that if a space follows the option letter, the program has no way to tell whether a following argument is supposed to be the password value or some other kind of argument. Consequently, the following two commands have two completely different meanings: