I have the suspiction that my MySQL installation and all databases are somehow borked. For a fresh start, I would like to create dumps from all the databases, uninstall MySQL, delete the data in /var/lib/mysql, reinstall MySQL, and then import all the dumps.

I know I could figure out the individual commands for each step.

But is there a more convenient, automated way to do this all at once, where I can leave the computer alone for a while, come back and it is finished?

$ mysql --version
mysql  Ver 14.14 Distrib 5.6.19, for debian-linux-gnu (x86_64) using  EditLine wrapper
  • 1
    Dump the data for security, but simply reinstall on top of the existing install. Why do you think it is borked?
    – Rick James
    Sep 6 '15 at 22:53
  • "Why do you think it is borked?" - Some slow queries. I could be wrong. But I think if we start to discuss this here it will hopelessly derail from the actual question. So let's just not :)
    – donquixote
    Sep 6 '15 at 23:46
  • "Dump the data for security, but simply reinstall on top of the existing install." - well this won't really "rebuild" the storage structure, so it would be kind of pointless.
    – donquixote
    Sep 6 '15 at 23:49
  • Also, from last time I read up on this, I remember that the files in /var/lib/mysql are not really self-sufficient and replaceable, but depend on some kind of global identifiers. This seems like a fragile system to me. I already did this with the data, and who knows what went wrong.
    – donquixote
    Sep 7 '15 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.