Terminal login failed

Hi. I am new to computing but do have some experience from years ago. I have a new mac with osx 10.10.1. In the process of installing/starting Apache, PHP and mySQL the login for Terminal quit working. It was near the end appending the path or changing permissions on some files. I have three screen shots. One is the terrminal screen run with default settings having timed out after 15 seconds. The Inspector screen was taken during the 15 seconds. The other screen was changing the command line to login with no path. Any help would be appreciated. Thanks Mike

Press the Results button and observe the bottom of the Action pane expands to show an empty list.

Click the Run button in the window's toolbar (or press cmd-R).

The command should produce some output.
If it doesn't, stop and describe exactly what happened, preferably with a screenshot of Automator.

Copy and paste the output in its entirety into a reply here. Use CODE tags.
You can select and copy all the output items to the clipboard by selecting one item in the list, then cmd-A (Select All), cmd-C (Copy).

Once we know what shell profile files you have in your home directory, we can tell you how to move them. As above, the commands will be pasted into an Automator "Run Shell Script" action.

There are other approaches; this isn't the only one. For example, you could create a new User account, login to that user, and run Terminal there. Assuming the installation didn't bork the system-wide shell profiles, that Terminal should work. Then it's just a matter of elevating privilege and moving the failing profiles out of the way.

It would provide some useful context for diagnosis if you told us exactly what procedure you were following for installing Apache, PHP and mySQL. Post a URL of whatever instructions or download you used, and exactly how far you got in the process.

In the "User Level Root" I did not get the listed response to Permissions on the file but everything seemed to work.

MySQL loaded and could be started and stopped through System Preferences and I continued on following the tutorial. Once I came to loading a new server in phpmyadmin. I see I can define a server there now but not save it as there is no .config folder. I believe I created a config folder in OS X, and am not sure wether it was web server writable or not. At one point here I was asked to login using my password but denied access. Looking to Terminal to try to resolve the issue I found that terminal would no longer login.

The 15 lines of code I had pasted into /Library/LaunchDaemons/com.mysql.mysql.plist I then removed.

I apoligize for not keeping records of what worked and what did not at each step.

Paste the above 3 lines into a single Run Shell Script action in a Workflow. Run it.

It won't produce any output, but it should do the following:
1. Create a folder named "bad" in your home folder.
2. Move two files there: "bash_profile" and "profile".

Look in the folder "bad", and if you see both files, then quit Terminal (if not already done) and relaunch it.

Does the Terminal window work correctly?

If so, then zip the two files in the "bad" folder and post them as an attachment. You can look at them in TextEdit first (drag onto TextEdit to open) and make sure they contain nothing compromising. They probably won't, but who knows.

If the Terminal window DOESN'T work, the problem likely resides at a deeper level and will take additional corrections.

It'll take a while to walk through the tutorial and figure things out. Having the bash_profile and profile might provide some important clues on that, so posting them could be useful.

The specific problem is in line 2. It tells the shell to read from "~/.bash_profile", i.e. it tells the shell to read commands from itself. The shell will do this, then encounter yet another command to read from "~/.bash_profile", which leads to yet another command to read from "~/.bash_profile", which leads to... infinite recursion.

I'm not going to experiment to discover what eventually limits this infinite recursion, but based on your earlier post it takes about 15 seconds to hit that limit. At that point the shell terminates.

Looking at the linked tutorial, I searched for the word "source".

Reading a few paragraphs there, it looks like your mistake arose here:

Exit the file with type “control + x” and when prompted save the change by typing “y”.​

That is, when you're editing ~/.bash_profile, it should contain exactly one line:

Code:

export PATH="/usr/local/mysql/bin:$PATH"

You should then SAVE the file and EXIT the nano editor. At that point you'll be back at the shell prompt. THAT'S where you execute the next two commands:

Code:

source ~/.bash_profile
mysql -v

That is, DO NOT put those two lines into "~/.bash_profile".

The original "~/.profile" appears to be fine. You can copy it back into place with this command:

Code:

cp ~/bad/profile ~/.profile

I don't think it will matter, because bash won't use it. From the bash man page:

When bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes com-
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable. ...
​

If you're still using MacPorts, then you'll need to reconcile ~/.bash_profile with ~/.profile.

Much appreciated. I had thought I could simply follow instructions without having to work things through myself. Possibly I don't follow instructions all that well. Imagine that!!

Click to expand...

This is one reason I will often use a newly created account for such adventures. If I bork something in the new account, I lose nothing by deleting it. I also usually take notes along the way, so I can reuse them later if I decide to apply to my main account.

Your tutorial used a lot of 'sudo' actions, so a lot of what it does will be system-wide. The safe thing there is a full backup before starting. Or a full backup, boot from that backup, and perform the tutorial on the backup. Again, if something goes wrong, the original is still safe and ready to go.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.