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 “”:

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

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:


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.

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: Logo

You are commenting using your 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. Blog at


Get every new post delivered to your Inbox.

%d bloggers like this: