Mediaportal MySQL Dependency Issues (1 Viewer)

josh.oram

Portal Member
June 6, 2012
16
1
43
Forster, New South Wales
Home Country
Australia Australia
I already have WAMP installed on my PC as I use it for Web Development. The MySQL service has the name "wampmysqld" and when i run SetupTV.exe and setup the DB settings, i put that server instance in the correct box and the test passes and all works fine. I double check in windows services and the TVService has the correct dependency for "wampmysqld"

My problem arises when I try and run the TV Server Configuration. I get a message about the TV Service depending on "MySQL" and if I want to enable autostart for it. I selected no, and when i do, if I check services, the TVService dependency has change to "MySQL", not "wampmysqld" as it previously was. I do have MySQL server installed seperately as well (did this when i first installed MP TV Server and it does have the service name of "MySQL". I don't want to uninstall it just yet until i can get TV Service to use my other DB Connection. There are no port conflicts or anything like that. Both SQL servers run fine alongside each other other than the issues I am having with MP.

Is TVService hard coded in any way to look for a service called "MySQL" in any way? TVService seems to run fine on startup, it is only when I try and run the Configuration tool that I run into problems.

If I uninstall my old MySQL Server, so I only have the WAMP one running is this likely to fix the problem? I really do no want to have 2 instances of MySQL running if I don't need to.
 

mm1352000

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

    No, the TV service is not hard-coded to look for "MySQL" in any way.
    You should be able to add a non-root "mediaportal" user to your existing DB, create an empty schema "MpTvDb" (or any name you care to use), and as long as you grant SELECT on mysql and all except GRANT on MpTvDb to the mediaportal user, TV Server should happily use your chosen schema with those credentials.

    mm
     

    josh.oram

    Portal Member
    June 6, 2012
    16
    1
    43
    Forster, New South Wales
    Home Country
    Australia Australia
    I have the schema and everything setup fine, that is not the issue. The problem only occurs when i try and run the TV Server Configuration, and it insists on wanting to use the "MySQL" service which is not even started, rather than "wampmysqld" which is running.

    If I run SetupTV and reconfigure it to use "wampmysqld" it works fine again, until once again I run the TV Server config and it complains about wanting to use "MySQL" again
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Can you check the connection string being used?

    1. Paste into the address bar in Windows Explorer:
    C:\ProgramData\Team MediaPortal\MediaPortal TV Server\
    2. Open the gentle.config file in any text editor and search for "<DefaultProvider name="MySQL" connectionString=".
     

    josh.oram

    Portal Member
    June 6, 2012
    16
    1
    43
    Forster, New South Wales
    Home Country
    Australia Australia
    The problem is not with the actual database setup. I exported the schema from my original MySQL server, and am using the exact same user credentials on both servers. The problem is that TVService is hell bent on using the Windows Service for my old MySQL server, rather than the one associated with my WAMP setup, even after I change it with TVSetup.exe and it all works well initially. It's just that the SetupTV.exe is breaking it[DOUBLEPOST=1366854064][/DOUBLEPOST]<DefaultProvider name="MySQL" connectionString="Server=Beast;Database=MpTvDb;User ID=root;Password=******;charset=utf8;Connection Timeout=30;" />[DOUBLEPOST=1366854195][/DOUBLEPOST]connection string seems to be the same no matter what i put for the dependency when i use SetupTV /configure-db
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    The problem is not with the actual database setup. I exported the schema from my original MySQL server, and am using the exact same user credentials on both servers.
    Understood.

    The problem is that TVService is hell bent on using the Windows Service for my old MySQL server, rather than the one associated with my WAMP setup, even after I change it with TVSetup.exe and it all works well initially. It's just that the SetupTV.exe is breaking it
    Lets break it down logically.

    To have two MySQL instances running on the same machine you must set the instances up to listen on different ports, right?
    To have TV Server (or any other application) connecting to a specific MySQL instance you must specify the port that the target instance is listening on in the connection string, right?
    As you can see, the connection string in your gentle.config file does not include any port specification, so the default port (3306) will be used. Are we still in agreement?
    In your case, which instance is running on the default port: the WAMP one, or the old one?

    As far as I can see, the service name and port are not hard-coded anywhere in TV Server.
    So that means the connection is entirely dependent on the connection string.
    And since the connection string doesn't currently contain any port specification...
    ...well, if your old instance is listening on port 3306 then it is no surprise that TV Server is connecting to that instance.

    Now having said that, if you are configuring the DB connection with a specific port and SetupTv.exe is somehow mangling the port specification... that would be a problem that could be investigated.
    Otherwise, as far as I can see there are no hard-coded references to service names (MySQL5, MySQL51, MySQL55) or port numbers (eg. 3306) that would cause what you're seeing.
    But if I'm right above, I would suggest to make sure you specify the port in the hostname/server field as "<hostname>:<port>".

    connection string seems to be the same no matter what i put for the dependency when i use SetupTV /configure-db
    The dependency is *not* used to specify the instance to connect to - correct.
    That is only used to set up the TVService startup dependency (ie. to ensure the correct DB service is started before TVService can attempt to start), and that is one time configuration. Again and in other words, that is configuration for the Windows service manager; it has no bearing on which instance of MySQL TV Server will actually connect to during normal operation.
    My understanding is that you should be specifying the TCP port to connect to as part of the hostname field.

    mm
     
    Last edited:

    josh.oram

    Portal Member
    June 6, 2012
    16
    1
    43
    Forster, New South Wales
    Home Country
    Australia Australia
    I have added port to the config string. It does work, and always did. I can get TVService to connect to either instance no problem. I can stop the MySQL service completely and have it connect to the other WAMP one but that is not my problem. And yes, I have both servers running on different ports. Ideally i only want to the one server running but I will not do this until I can get TVService to run properly with the other server. I still have the issue, and this is the main issue i highlighted before, that even if I change the dependency to "wampmysqld" in SetupTV.exe it only works until i try and run the TV Server Configuration, which then gives me a dependency error related to "MySQL" service... If i check in Windows Services after this error, the dependency gets changed automatically from "wampmysqld" which it was originally set to, and should be, back to "MySQL"
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello again Josh

    I have to admit that I'm struggling to follow here...

    I have added port to the config string. It does work, and always did.
    If that is the case, why did your gentle.config file not have the port specified in it?

    I still have the issue, and this is the main issue i highlighted before, that even if I change the dependency to "wampmysqld" in SetupTV.exe it only works until i try and run the TV Server Configuration...
    TV Server configuration == SetupTv.exe
    I'm confused! :confused:

    The DB connection window should only popup when SetupTv.exe is run with the /configure-db switch.
    Normally the /configure-db switch is only used for the first-run after installation.
    The purpose of the DB popup is to create the gentle.config file, setup the Windows service dependencies for TVService.exe, and create the database.
    After initial run, the /configure-db switch should not be used except in exceptional cases.
    Normally when SetupTv.exe is started it simply checks that it can connect to the DB. If it can't connect it assumes that you have changed DB or DB configuration, so the DB connection window is shown again.
    The MySQL service name is not stored in the TV Server database or gentle.config file as it is totally irrelevant for the purposes of connecting to the database.

    ...which then gives me a dependency error related to "MySQL" service... If i check in Windows Services after this error, the dependency gets changed automatically from "wampmysqld" which it was originally set to, and should be, back to "MySQL"
    You're not always running SetupTv.exe with the /configure-db switch, are you?

    Could you please post your tv.log and error.log file:
    1. Open TV Server configuration.
    2. Click "open log directory" in the top left corner.
    3. Zip up the appropriate files and attach/post.

    Please also post some screenshots to show exactly what you're doing and what SetupTv.exe is doing.
     

    josh.oram

    Portal Member
    June 6, 2012
    16
    1
    43
    Forster, New South Wales
    Home Country
    Australia Australia
    the config file had no port entry as i had changed my servers around so my wamp server was using the default 3306 port. And no i was not using the /configure-db switch every time. The issue was when i ran it normally. I only ran it with the switch to change the dependency as TVService insisted on setting it back to MySQL after i had changed it. It was because of this SetupTV.exe kept giving me errors about the MySQL service not being started. it couldnt start...it was disabled..it should not have been used. Anyway i ended up completely uninstalling MP and the MySQL Server that was first installed and set it up from scratch and i works fine now. I am thinking that even though MySQL was disabled at the time. the fact its port was set to default was the reason TVService kept wanting to use ir
     

    Users who are viewing this thread

    Top Bottom