# Remote access to mysql problems (SOLVED)

## woZa

I have setup mythtv and everything is working ok. Now I want to use mythclient on remote pc's to connect to the backend on my server. So I change the ip address in mythsetup to 10.0.1.4 (from localhost) and it won't connect with the error 

```
2005-08-01 16:14:28.473 Unable to connect to database!

2005-08-01 16:14:28.473 Driver error was [1/1045]:

QMYSQL3: Unable to connect

Database error was:

Access denied for user: 'mythtv@mydomainname' (Using password: YES)

2005-08-01 16:14:28.473 Failed to init MythContext, exiting.
```

Issuing the command 

```
mysql -h 10.0.1.4 -u root -p
```

 gives the same error. I have set bind-address to 10.0.1.4 in 

```
my.cnf
```

, tried GRANT ALL PRIVILEGES and am now stuck. It must be something simple but what is it??!!

TIA

----------

## elvisthedj

If you're certain it's not a network connectivity issue, then I would guess that maybe your sql statement was incorrect.  Did you do something like:

```

grant all on mythtv.* to mythtv@mydomainname identified by 'yourpassword';

```

Of course, that's assuming that your host is connecting as 'mythtv@mydomainname' ..  I'm at work, so I couldn't test the above statement (I usually test before I post to try to avoid being an idiot... sometimes it works)

I'd check the host name of the remote host and make sure you've granted access to all the tables in your myth db.

----------

## woZa

Thanks for the help. I retried the command as above but with mythconverg.* but still the same error. It is not network connectivity... The server can't connect when set to 10.0.1.4 rather than localhost. Even as root mysql user.

```
mysql -h 10.0.1.4 -u root -p
```

 fails with access denied for root@mydomain.org but 

```
mysql -h localhost -u root -p
```

 works fine. I haven't even tried to connect from the remote clients yet!

----------

## elvisthedj

What is the statement you are using to grant privleges?

----------

## woZa

```
grant all on mythconverg.* to mythtv@mydomain identified by '*******';
```

----------

## elvisthedj

Ok, didn't you say you are trying to connect as root@mydomain??  I've never connected with root @ anything other than localhost, so I've never had to do this, but maybe you need to add privleges for root@mydomain or do -u mythtv as it says in your sql statement.

(in other words, it looks like your granting access to one user (mythtv) and connecting as another (root).

----------

## woZa

Mythtv is tring to connect as user mythtv (the one i have granted privileges for). The root example was just to show that even root can not connect to mysql when the -h parameter is set. Only setting localhost will allow connection, not my actual ip address of 10.0.1.4 (or 127.0.0.1 for that matter). It doesn't matter who the user is. This is true when trying to connect to mysql (which rules out a mythtv setting problem - mythtv works fine if I set server address to localhost). This is no good though for remote clients connectng to the backend.

----------

## elvisthedj

Then maybe you only have mysqld listening on 127.0.0.1?

--> Here :

 *The page above wrote:*   

> 
> 
> By default, all users that are created in MySQL are allowed access only from the local computer (that is, localhost). In addition, MySQL by default only listens for connections on 127.0.0.1 (which is a local loopback address). This is why entering "localhost" for your mysql server mysql_connect works.
> 
> So, we now have to setup a user that can administer MySQL remotely (that is, from another computer than the one the server is running on).
> ...

 

----------

## woZa

Aaaaahhhh! I was trawling through the manual trying to find something like that... That has solved the problem. Thanks very much old bean!!!  :Very Happy: 

----------

## elvisthedj

"old bean"  :Very Happy: 

I feel so... Brittish!  I'll bet in the UK, Donald Trump is a funny name  :Laughing: 

----------

## woZa

Hahahaha! Don't even know why I said that! Been watching Blackadder Goes Forth (WWII comedy). Must have been that!

Tally ho and chocks away, back in time for tea and biscuits!

----------

