OneFreeVoice

April 16, 2008

pre-compiled binaries in your PATH

Filed under: GNU/Linux, MySQL — Tags: , , — Gregory Haase @ 4:29 pm

I prefer to install mySQL using the pre-compiled binaries. Depending on the environment, these usually go in either /opt or /usr/local. When you choose this type of install, chances are you are going to need to ensure that you somehow configure your system so that the mysql binaries end up in your PATH.

If you are using RedHat or CentOS, a good way to do this is to add a custom file inside of the /etc/profile.d/ directory. I create one called “mysql.sh”:

if ! echo ${PATH} | /bin/grep -q /opt/mysql/bin ; then
        PATH=/opt/mysql/bin:${PATH}
fi

This script simply checks you PATH for mysql and adds it if it’s not already there.

If you are using Ubuntu, you can edit /etc/environment:

PATH="/usr/local/bin:/usr/bin:/bin:/opt/mysql/bin"
LANG="en_US.UTF-8"

You can see that I’ve just added “:/opt/mysql/bin” to the end of the PATH line.

There are lots of other ways to do this, and I’m sure some distributions not covered here do it differently. If you know of a different or better way, I look forward to your comments.

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: