鍍金池/ 問答/PHP  Linux  數(shù)據(jù)庫  HTML/ mysqldump密碼問題

mysqldump密碼問題

在 web 服務(wù)器上使用 mysqldump 備份 MySQL 服務(wù)器的數(shù)據(jù)
如果這樣:

mysqldump -hxxx.xxx.xx.xx -uusername -ppwd db table --where="order_id > 4300284 and order_id < 4300293" > /xxxx/file.sql

明文輸入密碼,會(huì)提示:
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events
我想知道的是,在使用 mysqldump 命令的時(shí)候,不明文輸入密碼,即

mysqldump -hxxx.xxx.xx.xx -uusername -p db table --where="order_id > 4300284 and order_id < 4300263" > /xxxx/file.sql

類似直接在Linux中執(zhí)行,然后回車輸入密碼,但是在PHP程序中,怎么實(shí)現(xiàn)類似的功能呢?
也就是說 執(zhí)行完上條命令,該輸入密碼了,PHP怎么把密碼傳給Linux
謝謝諸位

回答
編輯回答
離魂曲

order_id > 4300284 and order_id < 4300263

你的條件寫錯(cuò)了吧
4300284
4300263

2018年3月1日 22:21