Categories
Posting XML as a parameter to a SOAP WebService Method | Home | XML Design in SQL Server 2005
Filed under on March 26, 2008 by Chris DaryMAMP MySQL Command Line Access
I love MAMP for local development on Mac OS X - it gives you a quick LAMP-style development environment on your machine with zero hassle - and it's free.If you're a user who also likes using MySQL on the command line to manage your local databases though, it might be a little confusing, because after installing MAMP you can't do so. Just run this in terminal and you should be set:
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql
What this does is add a symbolic link for the mysql binary from MAMP into your executable path - in this case, within /usr/local/bin/
Incidentally, /Applications/MAMP/Library/bin/ is where you'll also find all the other MySQL binaries, like mysqldump.
Warning: If you've installed MySQL manually as well, this may interfere with that installation, so don't do this if you have!
Comments
ali,
1: note that that is LN, not IN - 'LN' lowercase.
2: If you've already done that, what version of Mac OS X are you running?
Posted on April 29, 2008 11:39 AM by Chris Dary
Thank you, thank you, thank you.
I tried a lot of wrong advices, this one worked like a charm.
Posted on July 31, 2008 5:35 PM by tomo
I tried this and it says ln: /usr/local/bin/mysql: No such file or directory ...... help?
Posted on December 11, 2008 1:20 AM by Gary
Gary, did you type this exactly?
'sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql'
Because with that syntax, I don't know how you could get that error - unless /usr/local/bin didn't exist, which seems odd to me if you're on OS X.
If you could paste your entire command I might be able to help more.
Posted on December 11, 2008 8:52 AM by Chris Dary
Chris:
I just copied and posted exactly what you wrote into terminal, and got back:
ln: /usr/local/bin/mysql: No such file or directory
I'm on 10.5.6.
Posted on December 22, 2008 7:57 PM by Jim
Hi Jim,
Not sure why the /usr/local/bin directory wouldn't exist. Try typing this beforehand:
sudo mkdir -p /usr/local/bin
What this will do is create the /usr/local/bin directory for you if it doesn't already exist.
You might also want to check "echo $PATH" to make sure /usr/local/bin exists within your executable path.
If it doesn't exist in the string that comes out (separated by colons), just type:
open ~/.profile
and add:
export PATH=$PATH:/usr/local/bin
to that file, and restart your Terminal and you should be all set.
Hope this helps!
Posted on December 22, 2008 10:00 PM by Chris D
Before creating the symbolic link that Chris suggested here, I would get "mysql: command not found" unless I entered the whole path such as
/Applications/MAMP/Library/bin/mysql -u root -p
and in that case I would get a blank prompt and nothing would happen.
Now I get the blank prompt if I run any mysql command (including mysql --help), which I suppose is however a kind of progress.
Does anyone know what's wrong here? There may be a conflict with prior failed installations. I tried to install mysql previously with macports, but I uninstalled it later. I have a ruby on rails stack installed as well, but there's no mysql support there. I've just been using Sqlite3. I don't know if there could be a potential conflict with another mysql installation or not. How can I check? Or is there another solution that occurs to anyone?
I know that mysql is running--I can use phpmyadmin and query databases with php--but I'd really like to be able to use the command line! Any help is much appreciated!
Posted on March 14, 2009 8:52 PM by alex
Posting XML as a parameter to a SOAP WebService Method | Main | XML Design in SQL Server 2005

Thanks!
Posted on April 7, 2008 4:21 AM by Blake Lucchesi