Topic: MySQL

Hi,

I am having trouble with the MySQL part of Dan Benjamin's tutorial for installing RoR on OSX Tiger.  When I check to see what version of MySQL I have I get the following message:

NTS:~/src nicktoye$ which mysql
no mysql in /bin /sbin /usr/bin /usr/sbin /opt/local/bin

Any ideas?

Last edited by NickToye (2007-01-25 13:09:49)

Re: MySQL

It looks like mysql simply hasn't been installed yet.  Are there instructions for that?

Re: MySQL

I have installed it.  I downloaded the dmg file and installed all the apps.

Re: MySQL

Did you update your "~/.bash_profile" file so it can find the installation? Something like:

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

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

yes I did.

Re: MySQL

I'm assuming you closed and opened the terminal window after updating the profile. Does this command work?

mysql -V

If not, does this work?
/usr/local/mysql/bin/mysql -V

If not, perhaps it was installed in some other location.

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

Last login: Thu Jan 25 17:39:29 on ttyp1
Welcome to Darwin!
NTS:~ nicktoye$ mysql -v
-bash: mysql: command not found
NTS:~ nicktoye$ /usr/local/mysql/bin/mysql -V
/usr/local/mysql/bin/mysql  Ver 14.12 Distrib 5.0.27, for apple-darwin8.5.1 (i686) using readline 5.0
NTS:~ nicktoye$

Re: MySQL

Weird. See what this says:

echo $PATH

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

NTS:~ nicktoye$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/opt/local/bin
NTS:~ nicktoye$

BTW, do I need to be in the src folder?

Re: MySQL

Nope, but it looks like ".bash_profile" isn't being read. Did you put the period in front of the file name?

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

Yeah I'm sure I did.

Re: MySQL

I'm not sure what the problem could be then. For some reason the file isn't loading.

You can try recreating the file. The tutorial has you name it ".bash_login" which should work too, but if both exist one might be overriding the other.

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

Not sure what you mean?

Re: MySQL

Run these commands. Warning: You will lose anything in the .bash_profile/.bash_login files so back them up if they have information you want to keep.

cd ~
rm .bash_profile
rm .bash_login
echo "export PATH=\"/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH\"" > .bash_profile

The close the terminal window and open it up again. If that doesn't solve the problem I don't know what it could be.

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

Ok, Well I am at my parents on a PC so I'll have to do this later on tonight. 

But my problem may have been when I was trying to use my Terminal to build SVN so that I could download all the bundles for TextMate.  So I may just go with what you have suggested and remove the bash profile.

To be honest, I'm a little hazy with Terminal stuff, as I am used to PC's and not Mac's (terminal wise).  So I'm guessing that the bash profile holds information about me as a user?

Re: MySQL

Cheers Ryan,

BTW, do you do any consultancy work?

Re: MySQL

Nope, only through these forums. smile

If you are concerned with deleting something you can just move the file:

cd ~
mv .bash_profile .old_bash_profile
mv .bash_login .old_bash_login
echo "export PATH=\"/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH\"" > .bash_profile

I doubt there's any other information in the files unless your parents are Unix geeks. wink

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

smile

Its all working now.

I am embarking on a project and I want to use Rails to produce the backend for it.

Is this forum a rich vein of assistance in the learning process?

smile

Re: MySQL

NickToye wrote:

Is this forum a rich vein of assistance in the learning process?

Certainly. We won't do all the work for you, but if you have a problem you are stuck on and can't find the solution anywhere, feel free to start a topic on the forums.

Railscasts - Free Ruby on Rails Screencasts

Re: MySQL

Quick one.  What does this mean?

NTS:~/src/depot nicktoye$ mysql depot_development <db/create.sql
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'depot_development'