Quantcast
Channel: Uly.me
Viewing all articles
Browse latest Browse all 15

Run SQL in Bash

$
0
0

Here’s an example on how to run MySQL commands from Bash.

mysql dbname -e "UPDATE wp_options SET option_value='http://domain.com' WHERE option_name='home'";
mysql dbname -e "UPDATE wp_options SET option_value='http://domain.com' WHERE option_name='siteurl'";

The example updates WordPress’ home and siteurl. Script contains no password. It’s using .my.cnf config file.


Viewing all articles
Browse latest Browse all 15

Trending Articles