Actually I was trying to get the mysql command to work now I cannot access terminal. All I get is a cursor but no command line. I also cannot find the file I created in the Finder. I used command shift G to find the folder /usr and the file is not there.

You could try installing another terminal emulator and try to fix the situation through it.
–
lanzzJun 5 '12 at 20:34

Note that you can open the Terminal preferences and under Startup tab, you can set Shell open with to /bin/bash.
–
Harold CavendishJun 5 '12 at 20:46

I tried Harrold's suggestion and it did nothing. You might be right that this is not what caused the problem. Around this time I was also logging into mysql directly through its path in /usr/local/mysql/bin/mysql
–
user138304Jun 5 '12 at 20:53

Please answer your own question as soon as you can (i.e. in a couple of hours). There's a button below for that. Don't put the solution into the question. Thanks for sticking around!
–
slhck♦Jun 5 '12 at 21:31

2 Answers
2

Why is your bash not starting up?

If your bash is not starting up correctly, one of its configuration files is borked. These are:

/etc/profile

And after that, the first one of these it can find:

~/.bash_profile

~/.bash_login

~/.profile

If you followed that tutorial correctly, you created the ~/.profile file. But not in /usr. It should reside in your $HOME directory, which is at /Users/your-username, and known as ~ to the shell. You can put anything you want into /usr and it wouldn't affect bash starting.

Let's remove ~/.profile

Try to go into Terminal.app settings and changing the following:

The command you want to execute is:

/bin/rm /Users/your-username/.profile

Don't forget to untick Run inside shell. Of course, change your-username to your actual short user name. Once you open that Terminal profile, your existing .profile file will be deleted.

You can then uncheck the Run command field and try to start over.

Other means of debugging

If the above didn't help, from the same Run command field, try running:

/usr/bin/tail -n 10 /Users/your-username/.bash_history

This will trace back your last steps, which would be valuable information to add to your post.

Your Terminal shows Could not open a new pseudo-tty?

In that case, a reboot is needed. Somehow you created too many forks, exceeding the file system limits. This should be restored by simply rebooting your Mac.