JSS – Setting Path for MySQL on OS X Server

JSS – Setting Path for MySQL on OS X Server

os x yosemite, terminal, mysql logos


This post covers setting the path variable for MySQL on a JAMF Software Server running OS X 10.10.x Server & MySQL 5.6.x. The path for a user in OS X is a set of locations in the file system whereby the user can use certain applications, commands and programs without the need to specify the full path to that command or program in the Terminal.

So instead of entering something like this:

You could just type:

The variable is specified as a list of one or more directory names separated by colon (:) characters.

The “/bin“, “/usr/bin“, and “/usr/local/bin” directories are typically included in most users’ path setting (although this varies from implementation to implementation). The administrator also typically has “/sbin” and “/usr/sbin” entries for easily executing system administration commands.

Output Path

You can output your current path by entering the following command:

For example, on OS X with JAMF Software Server setup, you might see the following path:

Note, the “/Applications/Server.app” paths are for OS X Server application.

Add MySQL Path

To add a path for MySQL, you can create a text file named “mysql” in the following directory:

You can use the following command:

Or you can use your favorite text editor and create a file in that location with that path.

BBEdit paths.d directory mysql file

Note, you need a extra line break after the path line, else you will have issues path variable.

For example:

Notice, the addition text at the end of the path, “/binbin:/bin“. To fix the issue, open the file in your text editor and make sure there is a extra line break and test the path variable again.

After creating the mysql file, you can list the files in the “/etc/paths.d” directory with the following command:

Note, the file for “com.apple.server” that includes the paths for OS X Server application.

BBEdit paths.d directory com.apple.server file

Next, to test the path setup, quit and relaunch Terminal and run the following command:

And you should be able to just enter “mysql” to work with and options in MySQL.

For example:

No Comments

Leave a Reply