Database corrupted. Possible to repair? (1 Viewer)

RobNorthcott

MP Donator
  • Premium Supporter
  • October 9, 2007
    540
    102
    Dartmoor, England
    Home Country
    United Kingdom United Kingdom
    Come on devs, there are enough of us who have had this problem for it not to be a random thing, time to get it sorted out permanently?
    I don't think it's a MediaPortal problem, it's just MySQL is very sensitive to corruption. Most of the times I've had the problem it's been after something has gone wrong, like a crash or power loss (of course, it _could_ be MP that crashed, in which case it may be possible for somebody to do something about it if they can reproduce it). MS SQL seems less prone to problems IME, so it could be worth you trying that instead if you're getting lots of MySQL problems - for me though it's not a big enough deal for me to be bothered to change back when it's easy to fix if it happens (once you know how).

    Rob
     

    SimonP

    Portal Pro
    March 6, 2008
    51
    2
    Home Country
    United Kingdom United Kingdom
    It's happened to me twice, and neither time as a result of a major problem (AFAIK) so I'd have thought there was a way of detecting it and the repair built into MP? Fixing it is far from intuitive and the first time I had to do a complete clear-out and re-install MP from scratch.
     

    mm1352000

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

    I completely concur with Rob. I've never seen a problem reported with SQL Server but having said that I use MySQL and have never had the problem myself either (...yet :D). There are fundamental differences in the corruption resilience of the two databases (SQL Server = transactional, MySQL MyISAM tables = not transactional) so if you want a more reliable database engine then try SQL Server.

    mm
     

    Caleb

    Portal Member
    January 14, 2012
    38
    4
    I must say I never had any problem with corrupt db files when I was using MS SQL.
    That's because SQL Server is operating in transactional mode whereas MySQL is using MyISAM tables (which are fast, but susceptible to corruption because there is no transaction log).

    I've been using PostgreSQL a lot at work recently, which is free and seems extremely solid from the experience I've had (I think it was written by some of the original MySQL team after they fell out with Sun).
    Yes, I like Postgres too. :)

    I wonder if MP could be made to work with that?
    Theoretically yes, but it is more likely to happen in MP 2 than MP 1.

    Why does MP need a whole external DB app? Why not use one of the many embedded database solutions that are out there? SQLite for example. It supports transactions.
     

    RobNorthcott

    MP Donator
  • Premium Supporter
  • October 9, 2007
    540
    102
    Dartmoor, England
    Home Country
    United Kingdom United Kingdom
    Why does MP need a whole external DB app? Why not use one of the many embedded database solutions that are out there? SQLite for example. It supports transactions.
    It does use SQLite for some things. Actually, having said that, I think it may be plugins like TVSeries and MovingPictures that use SQLite - the rest of MP itself seems to use the external SQL server. Does seem a bit overkill to me as well, but presumably there was a reason for doing it that way when it was designed.

    Rob
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    I completely concur with Rob. I've never seen a problem reported with SQL Server but having said that I use MySQL and have never had the problem myself either (...yet ).

    Never had the problem either, despite a few bsods with nvidia drivers :mad:

    Considering MySQL is the default installed and with over 500,000 downloads (total estimated), we get about 40 or 50 corrupt db's per year, does not sound so bad when put like that.
     

    jhnjohn

    New Member
    February 8, 2012
    1
    0
    37
    My PC was acting up earlier and the logs show that my HD has a bad block and also a MySQL error that says "Incorrect key file for table '.\mptvdb\program.MYI'; try to repair it". How would I go about this? I've installed SQL Server Management Studio Express but I can't even connect to anything using it, so I'm in over my head here.

    I've attached the TV Server error.log.
    SQL database get corrupted due to an application failure , or when application get affected by virus or system failure, hardware crashes and due to many other reasons. These all make SQL data inaccessible . But corrupted SQL can be repaired either installation of an application or use MY SQL repair software.
     

    vcrapps

    Portal Pro
    March 11, 2012
    73
    17
    43
    Home Country
    United States of America United States of America
    You can also just run the Batch file Posted below, Password is still "MediaPortal":
     

    Attachments

    • SQL Corruption.zip
      262 bytes

    RobNorthcott

    MP Donator
  • Premium Supporter
  • October 9, 2007
    540
    102
    Dartmoor, England
    Home Country
    United Kingdom United Kingdom
    You can also just run the Batch file Posted below, Password is still "MediaPortal":
    That will only work if the current path is drive C: and the tvserver is shut down.
    If the tvserver is still running the MySQL files can not be fixed.
    You need a few extra lines to automate it (and the password can be added, making it a single-click thing), see the code I posted earlier :)
     
    Last edited:

    Users who are viewing this thread

    Top Bottom