Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Apr 6 '10 at 5:46

This question came from our site for professional and enthusiast programmers.

should go to, possibly serverfault, but feels like SU to me. – lexu Apr 6 '10 at 5:21
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
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

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.

share|improve this answer
+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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .