Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, August 5, 2012

MySQL drop all tables that follow a pattern

Playing around with drupal I had to drop all tables that were created by a module. To do so I used the following chain of commands :
mysql -u your_user -D your_database_name -e "show tables" -s | 
  egrep "^Whatever_" | 
  xargs -I "@@" echo mysql -u your_user -D your_database_name -e "DROP TABLE @@"

This will print out all the shell commands to drop the tables beginning with "Whatever_" (note the ^ regex notation). If you want it to actually execute those commands, remove the word "echo".

Thursday, April 8, 2010

Επιδιόρθωση του MBR

Όσοι έχουν dual boot windows με Linux με boot loader το grub έχουν σίγουρα αντιμετωπίσει το φαινόμενο να μην ξεκινάει ο υπολογιστής και να πετάει κάποιο σφάλμα ο grub. Σε αυτές τις περιπτώσεις, μια επανεγκατάσταση του grub μπορεί να επιλύσει το πρόβλημα που αντιμετωπίζεται. Για αυτό μάζεψα παρακάτω τις οδηγίες που επιτυγχάνουν την επιδιόρθωση του boot sector.