1

From terminal and trying to uninstall macports, I ran a command, rm -rf / macports...., that erased bunch of stuff. I feel ashamed about this, not realizing the space after /.

Since then, mysql is running but I cannot execute any of the mysql commands because it is not under /usr/local/bin/

I went ahead an reinstall mysql but without luck. What steps do you recommend on doing in order to be able to run mysql, mysqlduml, mysqladmin, from terminal? I can access databases from phpmyadmin, so mysql is running, don't ask me how.

3
  • should go to superuser.com, possibly serverfault, but feels like SU to me.
    – lexu
    Apr 6 '10 at 5:21
  • 2
    Do you have a time machine backup? or any other backup/copy of your previous setup? If not, the data is gone.
    – lexu
    Apr 6 '10 at 5:21
  • 2
    Unless you have a backup you're not going to recover any data. As for the fact your data is running i'm not sure if OSX has daemons but i bet that's where it's starting from.
    – Kravlin
    Apr 6 '10 at 6:01
3

Should I accidentally run rm -rf /, I would certainly go with a complete re-install of my system (1). As I would lose any trust in its reliability.

This is the second worst command you can possibly run. The first one being sudo rm -rf /. It will simply recursively remove all the files on your disk for which you have read/write permission, that's a show-stopper. Even if you are not an admin user it will still remove some files you can't restore.

Or, as commented by @lexu and @Kravlin, if you have a Time Machine backup, you can try to restore your system as it was before you ran that command. Hope you do have one.


(1) ...and also very likely punch me hard in the face.

1
  • 1
    +1. If you issue "rm -rf /" as root, you have no idea what you damaged. Just trying to bring back a few things you noticed missing, like mysql, while leaving everything else in a fragile unknown state is just a recipe for problems. @Ole, reinstall your system.
    – Spiff
    Apr 6 '10 at 15:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.