Jump to content

Problems configuring MySQL via the command line


brian914

Recommended Posts

So I am trying to follow this tutorial on Lynda.com and at some point I must have taken a wrong turn. I have everything installed on my machine and was in the process of configuring my MySQL via the Terminal. Somehow it can't find the mySQL and I am too new to the topic to even trouble shoot this situation. I am hoping that if I explain what I did, it will be clear to someone more knowledgeable where I went wrong and how to fix it.

 

Here is what I have on my computer now:

OS X 10.4.11 Intel

Server version: Apache/1.3.41 (Darwin)

PHP 5.2.4

/usr/local/mysql/bin/mysql Ver 14.12 Distrib 5.0.51b, for apple-darwin8.11.1 (i686) using readline 5.0

 

 

I was told to type the following:

My-Computer-1:~ brian$ echo 'export PATH=$PATH:/user/local/mysql/bin' >> ~/.bash_profile

 

Then the following:

My-Computer-1:~ brian$ cat .bash_profile

 

Which gives me this, which I know is wrong, as I should just get that line once:

export PATH=$PATH:/user/local/mysql/bin/

export PATH=$PATH:/user/local/mysql/bin

export PATH=$PATH:/user/local/mysql/bin

export PATH=$PATH:/user/local/mysql/bin

My-Computer-1:~ brian$

 

Then when I type this:

My-Computer-1:~ brian$ which mysql

no mysql in /bin /sbin /usr/bin /usr/sbin /user/local/mysql/bin/ /user/local/mysql/bin /user/local/mysql/bin /user/local/mysql/bin

My-Computer-1:~ brian$

 

So it can't find the mySQL, right? When I installed it, I just followed the default settings, as far as I know.

 

How do I fix this.

 

Thanks a lot for help with this!

I quick the terminal, does that qualify as logging out?

 

I did that and got this:

 

/bin:/sbin:/usr/bin:/usr/sbin:/user/local/mysql/bin/:/user/local/mysql/bin:/user/local/mysql/bin:/user/local/mysql/bin

 

 

 

Thank you so much for the help!

Firstly, your ~/.bash_profile file is foo bar'd. You need to (or should at least) remove all of the export PATH=$PATH:/user/local/mysql/bin lines and replace them with one...

 

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

 

Notice its /usr not /user also note there is no trailing forward slash.

What does foo bar'd mean?

 

Hehe, sorry. Thats my way of saying broken.

 

How do I remove them? I don't know the command line at all...

 

You can simply open your ~/.bash_profile file in a text editor and edit the file accordingly. Or, this will fix it in one go from the command line.

 

sed -i -e '/mysql/d' ~/.bash_profile ; echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile

I did this, so it seems nothing has changed.

 

My-Computer-1:~ brian$ sed -i -e '/mysql/d' ~/.bash_profile ; echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile

 

My-Computer-1:~ brian$ which mysql

no mysql in /bin /sbin /usr/bin /usr/sbin /user/local/mysql/bin/ /user/local/mysql/bin /user/local/mysql/bin /user/local/mysql/bin

 

My-Computer-1:~ brian$

 

You need to logout and back in for your new .bash_profile to take effect. Either that or you need to source the file. eg;

 

source ~/.bash_profile

 

Id'e recommend loging out and back in though, as there may be other environemt variables set somewhere else.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.