[mythtv-users] Debian install SQL problems

Matt Zimmerman mdz at debian.org
Sat Oct 11 01:11:23 EDT 2003


On Fri, Oct 03, 2003 at 10:06:32AM +1000, Daniel Quinlan wrote:

> Quoting Lorrin Nelson <lhn-public at the-fam.net>:
> 
> > Hi - Has anyone run the Debian installers recently? I'm having trouble 
> > installing mythtv-database -- during the configure step, I get this 
> > error and it aborts:
> > 
> > 
> > Failed to execute SQL: GRANT ALL PRIVILEGES ON mythconverg.* TO 
> > mythtv at localhost IDENTIFIED BY '\nYou have an error in your SQL syntax 
> > near ''' at line 1 at -e line 8, <> line 1.
> 
> check the value of DBPassword in /etc/mythtv/mysql.txt
> 
> on my box it was (generated by pwgen)
> DBPassword=(hk66Ew%
> 
> notice the unescaped (
> 
> when /usr/share/mythtv/mythsql sourced /etc/mythtv/mysql.txt it died
> 
> tv:/usr/share/mythtv $ ./mythsql
> ./mythsql: /etc/mythtv/mysql.txt: line 4: unexpected EOF while looking for
> matching `)'
> 
> the quick fix is to change the password in /etc/mythtv/mysql.txt and redo the
> GRANT
> 
> There's a diff below to hack mythsql to use sed instead of shell expansion.
> not pretty but it works

Good catch.  I assume this is on woody; the pwgen in unstable generates only
alphanumeric passwords, so I haven't run into such a problem.

> --- mythsql.orig        2003-10-03 09:57:13.000000000 +1000
> +++ mythsql     2003-10-03 10:00:46.000000000 +1000
> @@ -2,15 +2,8 @@
>   
>  temp=$(tempfile)
>   
> -. /etc/mythtv/mysql.txt
> -
> -cat >$temp <<EOF
> -[client]
> -user=$DBUserName
> -password=$DBPassword
> -database=$DBName
> -host=$DBHostName
> -EOF
> +echo '[client]' >$temp
> +sed -e "`tail -4 $0`" < /etc/mythtv/mysql.txt >> $temp
>
>  set +e
>  mysql --defaults-extra-file=$temp
> @@ -20,3 +13,8 @@
>  rm -f $temp
>   
>  exit $ret
> +# sed commands
> +s/^DBUserName/user/
> +s/^DBPassword/password/
> +s/^DBName/database/
> +s/^DBHostName/host/

A simpler solution, I suppose, would be to remove the -s from the pwgen
invocation in the first place, so that even the pwgen in woody would not
produce problematic passwords.

I'm moving and don't have access to my CVS tree and such right now, so I
can't do much about this presently, but I'll keep it in mind when I have a
development environment again.

-- 
 - mdz


More information about the mythtv-users mailing list