MySQL执行sql查询并上传至远程服务器
时间:2021-07-01 10:21:17
帮助过:1人阅读
=
‘your_db_address‘
db_port=
3306
db_username=
‘user‘
db_password=
‘password‘
db_name=
‘your_db_name‘
table_name=
‘your_table_name‘
output_file=
‘/tmp/output.txt‘
sql_stmt=
"USE ${db_name}; \
SELECT * FROM ${table_name}
"
mysql -h $db_host -P $db_port -u $db_username --password=$db_password -e
"$sql_stmt" -B > $output_file
MySQL执行sql查询并上传至远程服务器
标签: