[mythtv-users] How to automate a mysql script with a password protected database?

ray cielencki mythtv at rayslinky.com
Thu Apr 1 10:58:44 EST 2004


>I am trying to automate a script to create mpg symlinks to recordings. My
>sql database requires a password and I am trying to include the password in
>the script rather than entering it by hand each time I run the script. Here
>is the part of the script that pulls the data from mysql.
>
>----------
># Command to return the sql rows. Must have -N !!A
>$MYSQL="mysql -N -u root -p mythconverg";
>$SQL="select chanid, starttime, endtime, title, subtitle from recorded order
>by starttime";
>
>$data=`echo $SQL | $MYSQL`;
>----------
>I have tried various things like
>-p mypass
>-p 'mypass'
>
>etc but no joy. I am hoping someone with more sql background can point me in
>the right direction.
>
>TIA,
>
>Bill

-pmypass

no space between the "-p" and your password.

mysql -umythtv -ppassword mythconverg -e "select ...

enjoy,
/rayc


More information about the mythtv-users mailing list