Mysql here document

#!/bin/bash
##sdohn# trigger script after importing the database from our production site##

USER=secret01
PASS=**********
DB=mysql
SERVER=192.168.17.19

mysql -u$USER -p$PASS -h$SERVER $DB -t<<eof
show databases;
update WPRS.wp_options set option_value='http://192.168.17.20' where option_name ='siteurl';
update WPRS.wp_options set option_value='sdohn.com' where option_name ='blogname';
update WPRS.wp_options set option_value='Professional IT- DBA' where option_name ='blogdescription';
update WPRS.wp_options set option_value='http://192.168.17.19/wp-content/plugins/download-monitor/img/download.gif' where option_name ='wp_dlm_image_url';
update WPRS.wp_options set option_value='http://192.168.17.19' where option_name ='home';
eof

 

Dieser Beitrag wurde unter MySQL veröffentlicht. Setze ein Lesezeichen auf den Permalink.