开发者

Shortcut to MySql on Mac OS X?

I am trying to add a path so I don't have to keep typing usr/local/mysql/bin every time I want to start Mysql. I found instructions here that say:

Edit the file /etc/profile and update the path by adding: usr/local/mysql/bin/, for example: PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr开发者_高级运维/local/mysql/bin"

Problems:

1. There is no existing line in my profile file that says 'path'. This is what it currently says in profile: # System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval '/usr/libexec/path_helper -s'
fi
if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
fi

2. I really have no idea what I'm doing on a mac (yet). What do I add/change to the above file so mysql is easier to access?


It depends on whether or not you want all user accounts to have access to MySQL, or just you.

For everyone, edit /etc/profile as instructed and add the following to the end:
export PATH=$PATH:usr/local/mysql/bin

For just you (ALSO, this is safest so you don't accidentally mess up any system variables!):

Get a terminal session: Launch Terminal if it's not already running.

Make sure you're in your home directory:
CD ~

See if .bash_profile exists:
ls -al .b*

If it does, open it with your favorite text editor. If it doesn't, launch your favorite text editor and Save as... .bash_profile in your home folder.

Add this line to .bash_profile and Save:
export PATH=$PATH:/usr/local/mysql/bin

Then close Terminal and open again for the change to take effect.


Hope this works out for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜