• 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 / Archives for mysql

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 the 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

How to upload a mysql database from a sql.gz file

18th February 2013 by Alan Leave a Comment

How to upload a database from a database.sql.gz file.  For instance c-panel databse backup can create this file and you might want to use it up upload to a test system or when moving server

Shell
1
2
zcat  database.sql.gz | mysql -u username -p -h localhost databasename
password:

Executing this command line in the shell on your server will do the trick.

 

 

Filed Under: Linux, Tech Tips, Wordpress  Tagged: mysql

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 and Privacy 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.

Some affiliates use Cookies to track if you purchase from them, this allows them to apportion revenue to us you will need to refer to their specific privacy notices as to how you are tracked.

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 © 2019 · Badly Wired

This website uses cookies to improve your experience. Also when you click on affiliate links those links may use Cookies to track you to be able to apportion revenue to us. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy