[mythtv-users] mysqldump problem - "Got error: 1045: Access denied..."
Bruce Markey
bjm at lvcm.com
Wed Mar 12 23:02:21 UTC 2008
Josh White wrote:
> I'm working to update my system to .21, and from what I gather, the
> first step probably should be to backup the database of my current
> .20.2
Absolutely. I rarely if ever need a backup but when I do
it is critical to know that I can get back to status quo...
> setup. Unfortunately, I seem to have a problem with gaining the
> rights to do this. It seems my user or my password is wrong. I've
> researched my way to
> "http://www.mythtv.org/wiki/index.php/Backup_your_database" and
> following the instructions there (quoted below):
>
>
> $ mysqldump -u<myth_user> -p --extended-insert \
> --databases<myth_db_name> > mythdatabase.bak
>
> Password:<myth_password>
>
> So reading that, I assume<myth_user> should be replaced with
> the"user" from the database configuration 1/2 screen, which is by
> default"mythtv" and<myth_password> should be replaced with my
> password from the Database Configuration screen.
To peel back another layer, it needs to be the password for
the MySQL user of that name (note: not the same as the linux
/etc/passwd user).
> I also presume the<myth_db_name> should be whatever it's called in
> the Database configuration screen (mythconverg, by default)
Again, it is that MySQL database which ought to be "mythconverg"
if you haven't done anything unusual.
> I've tried all these settings (several times) and I get:
>
> "Got error: 1045: Access denied for user'mythtv'@localhost'
> --databases mythconverg> mythconverg.bak"
This says that you connected to the database server from a
client application. However, the credentials were not accepted.
Note that the '@localhost' may be important here. MySQL does
not accept a user from anywhere but only where a 'user' entry
is allowed:
bjm at bigboy ; mysql -uroot mysql
mysql> select host,user from user where user like 'mythtv%';
+-----------+--------+
| host | user |
+-----------+--------+
| 192.168.% | mythtv |
| bigboy | mythtv |
| localhost | mythtv |
+-----------+--------+
It is possible that you may not have an entry that is a match
for the user 'mythtv at localhost'
> All of my frontends connect to my backend and work fine, so I'm sure
> the user and passwords from the configuration screen work to grant
> some level of access to the database...
These may be connecting via mythtv at 192.168.% or mythtv at bigboy
in my case.
> What am I doing wrong? Any suggestions?
First try
$ mysql -u mythtv -pmythtv -hyourhostname mythconverg
If that works, use the same args for "mysqldump" .
If not, check the 'mysql.user' table as the MySQL root user
as I did above. If there is not an entry for 'localhost", try
these commands from the mythtv source file "database/mc.sql"
GRANT ALL ON mythconverg.* TO mythtv at localhost IDENTIFIED BY "mythtv";
FLUSH PRIVILEGES;
GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO mythtv at localhost IDENTIFIED BY "mythtv";
FLUSH PRIVILEGES;
If this still fails for you, the authoritative documentation
can be found at: http://dev.mysql.com/doc/refman/5.0/en/index.html
Hope this helps,
-- bjm
More information about the mythtv-users
mailing list