[mythtv-users] No database connection.

Nick Morrott knowledgejunkie at gmail.com
Mon Aug 6 17:55:12 UTC 2007

On 06/08/07, John Pierce <john.j35 at gmail.com> wrote:
> Hello!
> When I setup the new machine I put the hostname, mythtv user and
> password in the mysql database.  This allows the backend machine to
> connect to the mysql db and operate.
> I then added the name of my laptop to the database along with the
> mythtv user and password, when I try to connect it tells me that
> is not allowed to connect to the mysql database.  If I
> change the name to an ip address then I can connect, I never had to
> put in an ip number before, just the fqdn of my machine.
> This is the error message:
> Database error was:
> Host '' is not allowed to connect to this MySQL server
> What do I need to change to allow host name lookups rather than supply
> an ip number?

I'd strongly recommend setting down and reading
http://dev.mysql.com/doc/refman/5.0/en/access-denied.html and trying
some of the suggestions. If using hostname to connect to MySQL, you
must ensure that the hostname value in mysql.users is the same that
your machine returns from its DNS or hosts file. If you do not include
the FQDN in MySQL (e.g. Hostname = 'laptop') but your system is using
laptop.home is the full hostname, you will not be able to use
hostname-based access.

You can add a magic Hostname of '%' which will wildcard all IP and
hostnames, and should allow any host to connect. From the MySQL
referenc manual:

" If the following error occurs when you try to connect from a host
other than the one on which the MySQL server is running, it means that
there is no row in the user table with a Host  value that matches the
client host:

Host ... is not allowed to connect to this MySQL server

You can fix this by setting up an account for the combination of
client hostname and username that you are using when trying to

If you do not know the IP number or hostname of the machine from which
you are connecting, you should put a row with '%' as the Host column
value in the user table. After trying to connect from the client
machine, use a SELECT USER() query to see how you really did connect.
(Then change the '%' in the user table row to the actual hostname that
shows up in the log. Otherwise, your system is left insecure because
it allows connections from any host for the given username.) "

This and related MySQL access issues seem to be producing more than
their fair share of messages of late.


MythTV Official wiki:
MythTV users list archive:

"An investment in knowledge always pays the best interest." - Benjamin Franklin

More information about the mythtv-users mailing list