[mythtv-users] DB problem

chris at cpr.homelinux.net chris at cpr.homelinux.net
Fri Aug 19 13:30:57 UTC 2005

On Fri, Aug 19, 2005 at 11:59:59AM +0800, ????????? wrote:
> Host 'localhost.localdomain' is not allowed to connect to this MySQL
> server
> What should I do?

Your problem is that the mysql authentication looks at the username, 
password AND hostname before it allows access, and in your case the 
hostname isn't what the database was expecting.  I believe the myth 
installation inserts a rule for 'localhost' but not 
'localhost.localdomain'.  They may have the same IP address but MySQL 
does a literal match.

Your /etc/hosts file probably contains a line that says localhost.localdomain localhost
or possibly just localhost.localdomain
but it should say localhost localhost.localdomain

A better solution (as long as your MySQL server doesn't accept 
connections from the internet) is to remove the hostname component from 
the MySQL access lists.  That way you won't run into the same problem 
again if/when you add separate MythTV front-end machines.

Do the following as root:
$ mysql mysql
mysql> update db set Host='%' where Db='mythconverg';
mysql> update user set Host='%' where User='mythtv';
mysql> update tables_priv set Host='%' where User='mythtv';
mysql> flush privileges;

More information about the mythtv-users mailing list