Find the answer to your Linux question:
Results 1 to 7 of 7
Hi everyone. My server crashed a while ago and three MySQL tables cannot be opened. I get the error "Didn't find any fields in table 'tablename'". So i run mysqlshow ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    corrupt tables


    Hi everyone.

    My server crashed a while ago and three MySQL tables cannot be opened. I get the error "Didn't find any fields in table 'tablename'".

    So i run mysqlshow databasename tablename
    and this returns the following error:
    "mysqlshow: Cannot list columns in db: dbecommunity, table: tbforumsections: Can't open file: 'tbforumsections.MYD'. (errno: 126)"

    Any ideas how to fix this?
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Run myisamchk -e *.MYI in your db data dir to get list of corrupt tables. Use
    myisamchk -r -q table to try and do a quick recovery. if not, just use the -r option.

    EDIT
    Make sure mysqld isnt running

  3. #3
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    didn't work

    I tried that. found it on the MYSQL documentation site.

    It didn't work. I then tried coping the data file somewhere else. recreating the table and then coping the datafile back. repairing the index. but this failed as well.

    in the end I recreated the table from scratch.

    I am curious as to what might have caused this. it happened to three tables in one database simultaneously. it also caused two of my web pages to be corrupt.

    I was using winxp in the office with putty to maintain a SSH connection to the server and Dreamweaver for web page editing. Dreamweaver crashed during ftp and then everything fell apart.

    luckily I have a php script which produces a html page of the sql needed to create a table at the command line. I regularly save this as text on my pc. so I can ftp it up and feed it in to mysql. so recreating the dbase isn't difficult but the data isn't saved.

    is the mysql backup table command worth using or should i use another method to backup my databases.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Dont you have any valid backup made by mysqldump?? in that case you can recreate the tables and import the data??
    Regards

    Andutt

  6. #5
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    I have never had mysql corrupt is own data. When it happens, generally caused by a failing disk or another app. Try running fsck on your drive to see if there is any bad blocks.

  7. #6
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    hosted server

    I don't have super rights to the server as it's hosted. I get ssh access and special permissions but not root. I access a virtual server on a shared computer. hard ware access is limited. but disk problems are normally sorted and resolved without me ever knowing due to the level of redundancy - i just get emails telling me that stuff broke and then were fixed.

    QUESTION. what does mysqldump do?
    GUESS. Dumps all data into some sort of text file.

    If so is it in the correct format to use the import from text file feature?
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  8. #7
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Yes, it is in the correct form to import back into a database. After dumping it to a file, when you open it you will basicly see mysql syntax that creates tables and inserts data. You can read the data back into the db with a command like mysql database < dump_file.sql. Mysqldump also supports remote dumping by doing something like mysqldump database | mysql -h some.host.com backupdb. That is an easy way to backup to a remote server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •