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
    I've got this fix set up as a batch file on my HTPC machine - it seems to be needed quite regularly. The only part I can't work out how to automate is the password. Shutting down and restarting the tvengine service is easy, but is there a way to pass the password to that mysql command without having to type it in?

    I must say I never had any problem with corrupt db files when I was using MS SQL. It does seem to be a MySQL "feature". 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). I wonder if MP could be made to work with that?

    Rob
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    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.
     

    RobNorthcott

    MP Donator
  • Premium Supporter
  • October 9, 2007
    540
    102
    Dartmoor, England
    Home Country
    United Kingdom United Kingdom
    Thanks for the reply - I was just being an idiot! Looking at the MySQL documentation again and realised you can add --password=MediaPortal to the command line :)

    Edit: This works nicely as a batch file:
    Code:
    net stop tvservice
    c:
    cd \program files\mysql\mysql server 5.1\bin
    mysqlcheck mptvdb --auto-repair -e -u root -p --password=MediaPortal
    net start tvservice
     

    findftp

    MP Donator
  • Premium Supporter
  • September 20, 2011
    184
    35
    Nootdorp
    Home Country
    Netherlands Netherlands
    Since running MP Version 1.1. beta I have had a number of corruptions to program.myi.
    So I have been have used the following to repair mysql database files.

    CD C:\Program Files\MySQL\MySQL Server 5.1\bin
    mysqlcheck mptvdb --auto-repair -e -u root -p

    when asked password = "MediaPortal"

    Hope it help anyone as it took me hours to find how to do this. :confused:

    Wow, thanks a lot! My mediaportal is working again!
    I got a BSOD because of a conflict with a ramdisk, after that nothing worked.
    You made my day! Where can I donate!
     

    sincze

    Portal Pro
    September 18, 2011
    76
    1
    99
    mysqlcheck mptvdb --auto-repair -e -u root -p

    All Corrupt messages are gone now!.

    Tnx!

    I don't think a BSOD has a good influance on a live Database
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I don't think a BSOD has a good influance on a live Database
    Yes, that would be a fair statement. BSOD results in the loss of any data that has not been written to the HDD. This includes data in HDD write caches. MySQL would be more likely to be affected since it is not transactional as explained earlier.

    mm
    :)
     

    SimonP

    Portal Pro
    March 6, 2008
    51
    2
    Home Country
    United Kingdom United Kingdom
    Many thanks from me too. I've been tearing my hair out over these problems and this fixed it.

    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?
     

    Users who are viewing this thread

    Top Bottom