# Ruby/rails/mysql install on mac os x

**URL:** <https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868>\
**Category:** Rails\
**Created:** [January 8, 2006, 2:04pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868 "2006-01-08T14:04:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 2:04pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/1 "2006-01-08T14:04:39Z")

</div>

after successfully installing everything as described in this article:

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

i attempted the final step in the process of removing the two anonymous  
accounts for my new mysql install, and to assign a password to the  
administrator account.

however, when following the advised commands below:

shell\> mysql -u root  
mysql\> DELETE FROM mysql.user WHERE User = ‘’;  
mysql\> FLUSH PRIVILEGES;

as described here:

[http://dev.mysql.com/doc/refman/4.1/en/default-privileges.html](http://dev.mysql.com/doc/refman/4.1/en/default-privileges.html)

i get the following response from my os x terminal:

-bash: mysql: command not found

can anyone tell me what i’m doing wrong? any help would be most  
appreciated.

thanks,

tyler young

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 2:07pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/2 "2006-01-08T14:07:18Z")

</div>

tyler young wrote:

> i get the following response from my os x terminal:
> 
> -bash: mysql: command not found

Try “/usr/local/mysql/bin/mysql”.

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 2:32pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/3 "2006-01-08T14:32:08Z")

</div>

how about u try adding

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

to your .profile or .bash\_profile … depending on what your flavor  
is… and dont forget to grab a new shell after you save that  
change…

chris

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/4 "2006-01-08T14:45:27Z")

</div>

Andreas S. wrote:

> Try “/usr/local/mysql/bin/mysql”.

awesome, andreas. thank you so much for your help. i have been able to  
connect to mysql using your path recommendation.

however, when i initiate the first of the following two commands:

mysql\> DELETE FROM mysql.user WHERE User = ‘’;

i recieve an error:

ERROR 1044 (42000): Access denied for user ‘’@‘localhost’ to database  
‘mysql’

sorry if i’m missing something really simple here, (like the path  
above), but the command line environment is so foreign to me, i’m not  
clear where a command line is strictly syntax, and where i can actually  
declare things (like path, or user name) etc.

these being anonymous accounts i’m trying to delete, it makes sense to  
me that the user name would be empty, as shown above. however, i’m  
unclear on why my access was denied.

if it were a simple matter of administrator privileges, i’d have been  
prompted to enter my password in the terminal, right?

i have to catch some shut-eye right now, but i’m really looking forward  
to a) solving this, my first command-line problem, and b) learning more  
about this exciting new environment.

i really appreciate having communities like this one to help me along  
the way.

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 2:58pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/5 "2006-01-08T14:58:08Z")

</div>

Chris Lowder wrote:

> how about u try adding
> 
> export PATH="${PATH}:/usr/local/mysql/bin"
> 
> to your .profile or .bash\_profile … depending on what your flavor  
> is… and dont forget to grab a new shell after you save that  
> change…
> 
> chris

chris,

it looks like i was writing at the same time you were. i’ll try your  
solution for sure, but i have to ask, and let me say how silly i feel at  
having to ask these things, but admittedly, i’m about 30 minutes into my  
journey with rails, ruby, mysql, shells, and command-lines. 🙂

the thing is, i’m using textwrangler on my machine. the instructions i  
followed to modify the path in my .bash\_profile didn’t really work for  
me: i used ‘twdiff’ to invoke textwrangler from the terminal, and it was  
supposed to open either a) the existing .bash\_profile, or b) an empty  
document where i could add a path to the document, save it, and move on.

what i received instead was a print out of sorts, from within the  
terminal-no launch of textwrangler, and no file to modify or otherwise  
save. so, i created a file with textwrangler, added the path described  
in the install information, and saved it in my home directory.

trying to call up the otherwise invisible .bash\_profile with the  
terminal still does not work for me. so i don’t know how i can modify  
the file to include your export path.

and one last thing: by grabbing a new shell, do you mean quitting the  
terminal and restarting it?

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/6 "2006-01-08T15:26:51Z")

</div>

tyler young \<tyler@…\> writes:

> mysql\> DELETE FROM mysql.user WHERE User = ‘’;
> 
> i recieve an error:
> 
> ERROR 1044 (42000): Access denied for user ‘’ ‘localhost’ to database  
> ‘mysql’
> 
> if it were a simple matter of administrator privileges, i’d have been  
> prompted to enter my password in the terminal, right?  
> no.

first of all, add /usr/local/mysql/bin into your .bash\_login (or  
wherever)  
export PATH statement so you don’t have to type the full path. Make  
sure to  
either open a new shell or do source ~/.bash\_login to read in the new  
settings  
(if you are using bash).

secondly, when you start mysql client, do it like this:

mysql -uroot

Then you will be the root user and have privileges. As you read about  
on the  
mysql site, the starting root user has no password.

If you do mysql -uroot -p and then hit enter, you’ll see:

Enter password:

Since there is none currently, can just hit enter.

Other options are available via “man mysql” on your local system or  
through  
googling.

[http://www.google.com/search?q=mysql+man+page&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official](http://www.google.com/search?q=mysql+man+page&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official)

-damon

> **[Damon Clinkscales](https://damonc.onuniverse.com/)**
>
> Damon Clinkscales

---

<div class="post-metadata">

**Author:** ![meantangerine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@meantangerine](https://www.ruby-forum.com/u/meantangerine)\
**Post date:** [January 8, 2006, 9:53pm UTC](https://www.ruby-forum.com/t/ruby-rails-mysql-install-on-mac-os-x/51868/7 "2006-01-08T21:53:48Z")

</div>

im sing textmate at the moment so im not to sure how to do this with  
textwrangler… if worst comes to worst you can always download a  
trail of textmate here…  
[http://macromates.com/textmate/files/TextMate\_1.5.dmg](http://macromates.com/textmate/files/TextMate_1.5.dmg)

1. in your home directory (by default you are in this when you first  
launch a new shell) type ‘mate .bash\_profile’ without the qoutes…

2. this should either open the existing or a new file (like u said) to  
which you can add  
export PATH=“${PATH}:/usr/local/mysql/bin”

3. save your file, and get a new shell (applebutton + N)… or yeah  
you can just quit and restart terminal…

and that should be it… im not sure what the go is with that ‘print  
out’ that your getting… im still a n00b at this stuff too…

good luck with it,  
chris
