"Connection failed! Connection unexpectedly terminated." during tv setup

Discussion in 'Installation, configuration support' started by Jman100, August 6, 2015.

  1. Jman100

    Jman100 New Member

    Joined:
    August 6, 2015
    Messages:
    5
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    During TV setup with a windows 10 pc, when it attempts to connect, it throws that error, "Connection failed! Connection unexpectedly terminated.". I've tested the sql server directly and can login just fine, so I'm not sure what the issue is here.



    Thanks,
    Jman100
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hello and welcome! :)

    Did the MediaPortal installer install the SQL Server, or did you do it?
    If you installed SQL Server, have you ensured:
    1. There's no security software (eg. firewall) blocking the connection.
    2. The connection credentials are correct.
    3. The SQL Server account has permission to check whether a TV Server database/schema exists already, and create a new database if not.
     
  4. Jman100

    Jman100 New Member

    Joined:
    August 6, 2015
    Messages:
    5
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Hi!

    MediaPortal installed the SQL server. However while trying to fix the issue I went and downloaded MySQL5 myself and updated it successfully. I've checked, and everything is allowed through the firewall as necessary, connection credentials are correct, and the server account was set up by mediaportal so I assume that's also correct.
     
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    I'm starting to get rather confused.

    When using MediaPortal's TV Server, you have 2 choices of database:
    1. MySQL 5.x
    2. Microsoft SQL Server - often simply referred to as "SQL Server"
    When I read your first post I thought you were saying that you were attempting to use [Microsoft] SQL Server. I now think that you're saying you're attempting to use MySQL only. Please confirm.

    ...and this was when you got the connection error?

    That's really not recommended unless you know your way around databases. By doing this you may have just made things a lot more complicated for yourself.

    No, you've misunderstood the situation.

    MediaPortal doesn't set up an account unless it installs the database. You've told me that you installed the database, therefore MediaPortal has not installed the database... and therefore MediaPortal has not set up any account. In other words, you should not assume that anything is correct.

    With a self install you must choose one of 2 options, and configure appropriately.

    Option 1 - use default/built-in database administrator account ("root")
    This is not recommended for security reasons, however it is a little easier than option 2. The password will be whatever you chose/entered during MySQL installation. You must also configure the account to allow connections from all PCs which will run either MediaPortal or TV Server. When you see the "connection failed" error it means you haven't done one of:
    • corrected the password in the TV Server database configuration dialog
    • configured the MySQL account to allow connections from the PC that you're installing MediaPortal on

    Option 2 - create a new account
    This is the recommended option. If you're installing your own database then it's assumed that you know how to create a new user account and configure it appropriately.

    If you don't know how to do either of these things then it's a very good indication that you should not be attempting to install your own database. In this case I would recommend you full uninstall MediaPortal and MySQL and try to install MediaPortal from scratch. If you get stuck, report the problem and wait for assistance.
     
  6. Jman100

    Jman100 New Member

    Joined:
    August 6, 2015
    Messages:
    5
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I believe there's a bit of miscommunication here.

    MediaPortal installation fully installed MySQL5 itself. It made the user and everything. The issue arose at the SetupTV portion of the installation, on the "Setup database connection" window. MediaPortal installation made the root user with the default MediaPortal password and everything. I do know my way around databases, and when I say I tested it manually I mean i ran mysql.exe and logged in with the user and pass MediaPortal created.

    I did update MySQL5 and that may or may not have been bad but the issue was there before and after. The databases and all that updated fine using the MySQL5 installer (the root login worked for that installer).

    Microsoft SQL server has not been used at all during the entire process. I had no SQL server of any sort running or installed prior to running the MediaPortal installer. This is literally what your last sentence said, I installed from scratch and ran into this issue. The only odd thing I did was update MySQL5 AFTER MediaPortal installed it. The error was present before and after said update.

    Jman100
     
  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Thanks for clarifying.

    Okay. The only reason you will see the "connection failed" message is because the installer (actually SetupTv.exe running after the installer completes) is unable to connect to the database with the credentials you supply.

    If you're familiar with code, it's here:
    https://github.com/MediaPortal/Medi...3/TVLibrary/SetupTv/SetupDatabaseForm.cs#L479

    When you see the connection failed message:
    1. Which field(s) are red - database name, server host name, or both?
    2. Are you using a host (computer) name or IP address? If using a host name, what happens if you try the IP address?
     
  8. Jman100

    Jman100 New Member

    Joined:
    August 6, 2015
    Messages:
    5
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    1. Hostname is red, dependency is green, and everything else stays white.
    2. I am using host name, however the local IP shows the same error. Note the error is "connection unexpectedly terminated", so I know it's seeing the SQL server. When i put in gibberish (or if the sql server isnt running) it says "Unable to connect to any of the specified MySQL hosts."

    Screenshot attached of resulting window.

    I get the gist of what the code you linked is doing. It should be working, and I have no idea why it isn't.
     

    Attached Files:

    • sql.png
      sql.png
      File size:
      22.6 KB
      Uploaded:
      August 6, 2015
      Views:
      69
  9. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Not that it should make any difference, but did you change the "dependency" manually? That needs to match the Windows service name, which is usually MySQL5.

    Aside from that I'm stumped. As you say, this should work. To me the behaviour you describe along with the "connection unexpectedly terminated" does sound like a firewall may be [partially] getting in the way. That would be the thing I'd be looking at now.
     
  10. Jman100

    Jman100 New Member

    Joined:
    August 6, 2015
    Messages:
    5
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Dependency started off as MySQL5 and changes when I hit the Test button.

    I'll look around at anything that could be blocking this, and I'll post here if i figure it out. Thanks for your help![DOUBLEPOST=1438844794][/DOUBLEPOST]Well, this is interesting..

    I have a headless virtual environment (VirtualBox VM) that is used for web development for work. It must have been causing issues, because I shut down that VM and everything works now.

    I'm not sure how to use both at the same time though...is there a port I can change or something with the MediaPortal DB?
     
    Last edited: August 6, 2015
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!