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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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$

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

I just did this:

 

My-Computer-1:~ brian$ which mysql

/usr/local/mysql/bin/mysql

 

My-Computer-1:~ brian$

 

 

So that means it is doing what I have been trying to make it do, right?

So excited.

 

Thank you so much for your help!!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.