• Home
  • Cloud
    • General
    • SaaS
    • BPaaS
    • PaaS
    • IaaS
    • Other Internet Hosted Applications
      • WordPress
        • WooThemes Canvas
          • WooThemes Canvas CSS
  • About me
  • Why Badly Wired?
  • Contact

Badly Wired

Cloud solutions, technical snippets and other goodies

alan
You are here: Home / Linux / Repairing MYSQL database after a crash
  • Free business email hosting for 15 days »
  • The best selling cloud solution right here »
  • 20% off Google Apps for Work Promo Code UK»

Repairing MYSQL database after a crash

19th January 2014 by Alan Leave a Comment

With linux, its a good idea to monitor your disc space carefully as if you run out of space you can create all sorts of problem.  Elsewhere I will post a disc space usage script that you might find useful.

So you had a crash due to lack of space it is highly likely that if you are running an active LAMP server you will have ended up with corrupted database tables. These need to be fixed.

These can be fixed one by one by going into mysql (using phpmysqladmin if you like) and doing

1
<em><strong>REPAIR TABLE table_name</strong></em>

However, you probably want to go through all your tables, and indeed if you have multiple databases, all your databases and repair them all.

How to do it is documented here, however the command line command you want is (on one line)

1
<strong>myisamchk --silent --force --fast --update-state --key_buffer_size=64M --sort_buffer_size=64M --read_buffer_size=1M --write_buffer_size=1M  path_to_database_files/*/*.MYI</strong>

Of course you need to identify and change  ‘path_to_database_files’ on Centos you will probably find this is  ‘/var/lib/mysql’ so teh command line you want for Centos would be
1
<em><strong>myisamchk --silent --force --fast --update-state --key_buffer_size=64M --sort_buffer_size=64M --read_buffer_size=1M --write_buffer_size=1M  /var/lib/mysql/*/*.MYI</strong></em>

Filed Under: Linux, Tech Tips, Useful Stuff  Tagged: mysql, repair table

About Alan

I'm Alan, a principal consultant at Fullworks Digital Ltd, a web development / cloud systems consultancy

My day job consists of looking into clients' businesses systems and sorting out their technology and often managing the implementation of change. The focus being leveraging the cloud primarily through the Google business applications (Google Apps for Work) as well as a significant amount or WordPress work.

I started as a professional programmer in 1979 and had been involved with the IT of business technology in virtually every area that exist.

My personal blog is my aide memoire of the many interesting facts that I come across. As I spend a lot of time gathering parts of solutions from the internet and assembling them into my own solutions, and also just learning how to do things, this blog is primarily my 'note book' and a way of giving something back to the online community that has helped me extensively.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Applications
  • Cloud
    • General
    • Google Cloud
    • IaaS
    • Other Internet Hosted Applications
      • Wordpress
        • WooThemes Canvas
        • WooThemes Canvas CSS
    • SaaS
  • Code snippets
  • Discounts
  • Genesis
  • Google Apps for Works
  • Linux
  • News
  • SEO
  • Server setup
  • Services
  • Tech Tips
  • Uncategorised
  • Useful Images
  • Useful Stuff

Tags

background jobs beadcrumbs bind brandings Cache canvas Centos chrome css fail2ban Find firefox Flash fraud genesis gocardless godaddy Google google maps hackers internet explorer javascript KashFlow Linus linux Magento mapquest maps microsoft mysql news nohup php plugin plugins queens diamond jubilee replace SED SEO skype Varnish Virtualmin Webmin woothemes Wordpress

Subscribe to my Newsletter

Sign up to my occasional newsletter

 

Affiliate Notices

This site is free to use, but hopes to cover some costs through affiliate income, some products and links are affiliates and may earn the site advertising income.

This site is a participant in the Amazon EU Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk.

  • Privacy Policy
  • Account
  • Register
  • Memberships

Copyright © 2018 · Badly Wired

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy