an all in one bash one liner would be:

[code]
echo "GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '$(grep -m 1 password /etc/mysql/debian.cnf | cut -d" " -f3)'; flush privileges;" | mysql -u root
[/code]