[solved] unable to connect to database all ports fine (1 Viewer)

Dukenukemx

Portal Pro
October 10, 2009
76
2
Trying to watch TV from another local computer and I get this error. "unable to connect to database all ports fine" TV plays fine on the computer that has the capture card installed using MediaPortal. Both machines have MediaPortal 1.10 installed.
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Thanks :)

    So my guess is that either:
    1. A firewall (or firewalls) on either or both the client and/or server is preventing the client from connecting to the database on the server.
    2. The database on the server is configured to not allow connections from other PCs.
    To check the first point, simply disable all firewalls (don't forget the built in Windows firewalls) on the client and server and try again.
    If that doesn't work, try the second point. You can see how to configure the MySQL server user access in the first three instructions in this post:
    https://forum.team-mediaportal.com/threads/install-fails-with-mysql-exception.126169/#post-1084386

    By default the root user that you're using probably can only connect from the local PC. So, either you need to allow the root user to connect from the client PC (or all hosts), or create a new user with the required permissions and reconfigure TV Server to use that DB user (instead of root).
     

    Dukenukemx

    Portal Pro
    October 10, 2009
    76
    2
    Here's what I got setup so far. The guide was using an older version so things changed. Tried to copy as best as I could. Renamed anonymous user to mediaportal and gave it the password MediaPortal. Still problems with clients connecting to TV server. Firewall was already disabled. Kodi even has a problem connecting from the same PC that runs the TV server. MediaPortal still doesn't on the TV server itself.

    mysql.jpg
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Renamed anonymous user to mediaportal and gave it the password MediaPortal.
    Probably not a good idea to rename the anonymous user.

    Still problems with clients connecting to TV server.
    Changing the MySQL configuration by itself will make no difference. TV Server and all clients will still be connecting with the "root" user. As your screenshot shows, the root user can only connect from the PC that MySQL is running on. This is exactly what I was trying to say in my previous post:

    By default the root user that you're using probably can only connect from the local PC. So, either you need to allow the root user to connect from the client PC (or all hosts), or create a new user with the required permissions and reconfigure TV Server to use that DB user (instead of root).

    Kodi even has a problem connecting from the same PC that runs the TV server.
    I'm not able to help you with Kodi.

    MediaPortal still doesn't on the TV server itself.
    As above. MP is connecting with the root user. That means it will work fine if MP is running on the same PC as MySQL, but fail if MP is running on a different PC.
     

    Dukenukemx

    Portal Pro
    October 10, 2009
    76
    2
    Renamed anonymous user to mediaportal and gave it the password MediaPortal.
    Probably not a good idea to rename the anonymous user.
    Should I create another anonymous user?

    Changing the MySQL configuration by itself will make no difference. TV Server and all clients will still be connecting with the "root" user. As your screenshot shows, the root user can only connect from the PC that MySQL is running on. This is exactly what I was trying to say in my previous post:
    I don't know what I'm doing wrong. :( What do I do to keep the clients from connecting to root?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Should I create another anonymous user?
    I don't know the correct configuration for the anonymous user, so recreating it properly would be difficult. If I were you I would try to undo whatever I had done.

    I don't know what I'm doing wrong. :( What do I do to keep the clients from connecting to root?
    ...and unfortunately I don't know how to explain any clearer. :(

    You have two options to solve this problem:

    1. Change the "root" user configuration to allow the "root" user to connect from additional PCs.
    2. Create a new user (or try to use your modified anonymous user) for MP and TV Server to use, and then configure MP and TV Server to use this user.

    For the first option, you simply change the "limit connectivity to hosts matching" from localhost/127.0.0.1/::1 to whatever you need it to be:
    upload_2015-1-13_10-44-56.png


    You might change it to "%" to enable root to connect from any PC... or you might specify the IP address of the PC that is your MP client for better security. Your choice.


    For the second option, you create a new user as instructed in the post that I previously linked (I'm not able to give better instructions than are in that post).
    To configure MP and TV Server to use that new user, you must update "c:\ProgramData\Team MediaPortal\MediaPortal TV Server\gentle.config" (this is a text file that can be opened in any text editor - notepad, wordpad etc.) and update the connection configuration.
    The connection configuration is this line:
    <DefaultProvider name="MySQL" connectionString="Server=HTPC;Database=MpTvDb;User ID=root;Password=MediaPortal;charset=utf8;Connection Timeout=30;" />

    You need to change "User ID=root" to match the name of the new user account you create.
    You need to change "Password=MediaPortal" to match the password for the new user account you create.

    Repeat those changes for "c:\ProgramData\Team MediaPortal\MediaPortal\gentle.config" on the server and client, and the problem should be solved.
     

    Attachments

    • upload_2015-1-13_10-44-38.png
      upload_2015-1-13_10-44-38.png
      40 KB

    Dukenukemx

    Portal Pro
    October 10, 2009
    76
    2
    I altered the "gentle.config" on both machines to point to user mediaportal. Both TV and client. Nope, still nothing. But TV works just fine on the host computer. Rebooted the machine and still the other PC won't connect. MediaPortal configuration still says "connection to the TV server successful" .

    I then removed MySQL and used MediaPortal 1.10 installer to reconfigure MySQL proper. It didn't change anything but I still had to reconfigure MediaPortalTV, though not too much. WebMediaPortal works with the TV server on the other machine. Cause I reinstalled MediaPortal, all the gentle.config went back to root. I changed it back but it makes no difference.

    I checked to see what's using what and some use root.
    connections.jpg
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I altered the "gentle.config" on both machines to point to user mediaportal. Both TV and client.
    Very important: you need to make sure you alter the TV Server one, because that one is copied for MediaPortal on all clients. To be clear, any changes in the MediaPortal ones that are not also made in the TV Server one will be overwritten.

    But TV works just fine on the host computer. Rebooted the machine and still the other PC won't connect. MediaPortal configuration still says "connection to the TV server successful" .
    Which machine did you reboot - client-only or client-server (HTPC)?
    Rebooting the client-only would make no difference. Rebooting the client-server might help.

    I then removed MySQL and used MediaPortal 1.10 installer to reconfigure MySQL proper. It didn't change anything but I still had to reconfigure MediaPortalTV, though not too much.
    If you had asked I could have told you that wouldn't help. ;)
    Really, the two solutions I listed in my previous post are the only way you are going to solve this problem. No amount of reinstalling will help.

    WebMediaPortal works with the TV server on the other machine.
    That's because MPExtended (which presumably connects to the database as root also) is running on the server. The root user will have no problem connecting to the database from any program running on the server, whether that be TV Server itself, MPExtended, or any other software. WebMediaPortal has no problems because it does not try to connect to the database directly like MediaPortal does.

    Cause I reinstalled MediaPortal, all the gentle.config went back to root. I changed it back but it makes no difference.
    As above. Make sure you change the TV Server configuration, otherwise the MediaPortal configuration changes are all overwritten.

    I checked to see what's using what and some use root.
    It looks like you're making progress though, because some are using mediaportal. According to your previous logs 192.168.1.5 is HTPC (the server). I can't tell if that is TV Server without fresh logs.

    If you want further help from me, fresh logs from both the client and server (HTPC) would be helpful at this point.
     

    Users who are viewing this thread

    Top Bottom