[mythtv-users] What to do when you can't remember the password for mysql
Keller Giacomarro
keller.g at gmail.com
Fri Apr 20 06:20:48 UTC 2007
On Fri, 2007-04-20 at 01:58 -0400, Kevin J. Cummings wrote:
> OK, a while ago, I setup MythTV on my home server (with a PVR-350 card)
> on FC5 before Jarod had updated his instructions for FC5. I muddled
> through the installation, using a combination of the FC4 and FC3
> instructions, and using RPMS from ATRPMS, I got MySQL, ivtv, and mythtv
> all installed an running. Woo Hoo!
>
> I was able to add a new PC5500-HD card to my setup this past Christmas
> without any problem. Great! Cool!
>
> Now, I want to add a remote frontend. This requires a change to the
> MySQL setup. I have to issue a GRANT command like so:
>
> > $ mysql -u root mythconverg
> > mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
> > mysql> flush privileges;
>
> My problem? When I try and login to mysql I can't remember the password
> I used for root! I am able to login as mythtv, but trying to issue the
> "grant all" command gives me:
>
> ERROR 1044 (42000): Access denied for user 'mythtv'@'localhost' to
> database 'mythconverg'
>
> Am I scrod? Can anyone tell me how to re-gain root access to my mysql
> database?
>
NOTE: Posted in the right place this time. List gods, please don't
smite me! =(
There may be a more elegant solution, but here's what I did when I
accidentally deleted the MySQL root account once (!).
Use the following command to dump your database to disk.
mysqldump -u mythtv -p mythconverg -c > mythtv_backup.sql
In Ubuntu, I just go into Synaptic and tell it to "Completely remove"
the MySQL server. This basically strips everything MySQL server off the
system including configuration files.
Now, reinstall MySQL server - you'll have a clean slate. Change the
root password to "password" or something else easy to remember. =P
Now use the following commands to restore your database.
$ mysql -u root -p
mysql>create database mythconverg;
mysql>exit
$ mysql -u mythtv -p mythconverg < mythtv_backup.sql
That should restore your data correctly and give you a fresh database with a root password you know.
Good luck!
-Keller
Reference : http://www.mythtv.org/wiki/index.php/User_Manual:Periodic_Maintenance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070420/65de7ad4/attachment.htm
More information about the mythtv-users
mailing list