Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > mysql help

mysql help
Thread Tools
loren s
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 12, 2006, 10:16 AM
 
I need to set enviroment paths on osx intel mbp to use mysql as command line

I used

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
For tcsh, use:

alias mysql /usr/local/mysql/bin/mysql
alias mysqladmin /usr/local/mysql/bin/mysqladmin
Even better, add /usr/local/mysql/bin to your PATH environment variable. For example, add the following line to your $HOME/.bashrc file if your shell is bash:

PATH=${PATH}:/usr/local/mysql/bin
Add the following line to your $HOME/.tcshrc file if your shell is tcsh:

setenv PATH ${PATH}:/usr/local/mysql/bin
If no .bashrc or .tcshrc file exists in your home directory, create it with a text editor.
But no matter what I do it wont save the settings to use mysql as a command in a new terminal window.. The only way it works is if I use alias mysql /usr/local/mysql/bin/mysql in the window then use the command mysql .. so each time I start a new window I have to paste that long line in.. It's not like it's a pain just silly and so
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jun 12, 2006, 07:00 PM
 
You need to edit your .bash_profile/.bashrc or .tcshrc. Just stick the proper line in a file with that name in your home directory (the dot is important; create it if it doesn't exist), and if you did it right, the next terminal window you open will work.

HTH

(BTW: This should be in the Unix forum, though.)
[Wevah setPostCount:[Wevah postCount] + 1];
     
loren s  (op)
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 14, 2006, 03:36 PM
 
Sweet ! .bash_profile was the ticket ! many thanks

OH GREAT that messes up aLOT of other stuff now...
( Last edited by loren s; Jun 14, 2006 at 04:41 PM. )
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:38 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,