[mythtv-users] database access

Paul Gallaway pgallaway at gmail.com
Sat Mar 7 18:03:24 UTC 2009


I was having a similar problem as the OP only my problem was I could
only connect from the localhost and mythweb was not working. I
resolved my situation based on Nick's recommendation:

On Wed, Mar 4, 2009 at 11:47 PM, Nick Morrott <knowledgejunkie at gmail.com> wrote:
[snip]
> mysql> SELECT `Host`,`User`,`Password` FROM `user` WHERE `User` = 'mythtv';
>
> Check to see if the password hashes are the same for all occurences of
> the mythtv user, and that you have any entry for localhost.

mysql> select `Host`,`User`,`Password` from `user` WHERE `User` = 'mythtv';
+---------------+--------+-------------------------------------------+
| Host          | User   | Password                                  |
+---------------+--------+-------------------------------------------+
| localhost     | mythtv | *07B8126C2DD7B5C86540517EEC78CC3AC92C9FA8 |
| %             | mythtv | *07B8126C2DD7B5C86540517EEC78CC3AC92C9FA8 |
| 192.168.1.% | mythtv | *CC8F35F587CA5A556B4132C2407E556D92172FFC |
+---------------+--------+-------------------------------------------+
3 rows in set (0.04 sec)

So this shows my password hash doesn't match on the 192.168.1.%
connections which is what is restricting access within my local network.
[snip]
> I'm guessing that either you don't have privileges to connect from
> localhost as MySQL user 'mythtv' to the mythconverg database, or that
> the password for the user/host combo is not correct.
>
> You might also check your my.cnf file to see if the MySQL server is
> bound to a particular hostname/IP.

I had checked for the correct password in all the files, check my.cnf
etc but this was the only thing I have seen that showed me how check
what was in mythconverg.

Here's how I fixed it.

mysql> drop user 'mythtv'@'192.168.248.%';

This got rid of the user with the faulty password.

mysql> select `Host`,`User`,`Password` from `user` WHERE `User` = 'mythtv';
+-----------+--------+-------------------------------------------+
| Host      | User   | Password                                  |
+-----------+--------+-------------------------------------------+
| localhost | mythtv | *07B8126C2DD7B5C86540517EEC78CC3AC92C9FA8 |
| %         | mythtv | *07B8126C2DD7B5C86540517EEC78CC3AC92C9FA8 |
+-----------+--------+-------------------------------------------+
2 rows in set (0.00 sec)

So everything worked which is good. So I added the host 192.168.1.%
back - this time with the correct password and everything still works.
Which leads me to the question, how do I get rid of the '%' host for
mythtv? If I do "drop user 'mythtv'@'%';" won't I loose all of the
hosts including localhost and 192.168.1.% since the '%' is a wildcard?
Or in this case am I specifying host equal to '%' where this time '%'
is understood as char and not the wildcard? Anyway, would rather not
wipe out my database ;)

-- 
~pAul.

        all good things. all in good time.


More information about the mythtv-users mailing list