Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am reading MySQL's manuals.

They suggest me that the command

cd /usr/local/mysql
sudo ./bin/mysqld_safe          // it seems that sudo = . + master rights

is the same as

. /usr/local/mysql/bin/mysql    // only ., no master rights

Are the two commands same in action?

share|improve this question
The single dot only signifies your current directory, which is why 'cd' is used with it. – Andrioid Jul 5 '09 at 9:54
I have added a question and answer that discusses the use of the dot and the difference between its use for sourcing a file or specifying the current directory. See… – Dennis Williamson Jul 5 '09 at 13:02
up vote 5 down vote accepted
. /some/path

executes [ or includes - which is execution ] a shell script you pointed.


[ notice lack of space after dot ] executes program/script using relative path [ from current directory, not from the top of filesystem ]

sudo executes given command with other [ usually root ] user's privileges.

there is difference between

cd /usr/local/mysql



the difference is current working directory. for mysql probably that does not meter, but for other/badly written programs that use relative paths - it might meter.

share|improve this answer

No, those commands are completely different. You may have a typo in there -- the following two commands are equivalent:

cd /usr/local/mysql
sudo ./bin/mysqld_safe


sudo /usr/local/mysql/bin/mysqld_safe
share|improve this answer

From Freshmeat:

Sudo (su "do") allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments.

I'm not sure that you are confused about this, but you might be based on the question.

If you're only confused about why

cd /usr/local/mysql

Is the same as


This is because in UNIX, the . means the current directory. So in this way, you will not search your PATH variable for the nearest mysqld_safe and run it, you will specifically run the one at /usr/local/mysql/bin/.

share|improve this answer
I am not sure why you can execute a PATH without "." --- This suggests me that "." or source must be in the PATH. – Masi Jul 5 '09 at 10:03

In this command:

cd /usr/local/mysql
sudo ./bin/mysqld_safe

starts the mysql server. As others have said, the period signifies the current directory. It is used in this way to, for example, override the $PATH or to execute a program that's not in $PATH. Remember, in bash, etc., the current directory is not in the $PATH unless you add "." to it (not recommended for security reasons).

Then this command allows you to access mysql:


Note that there's no dot (".") at all in this command.

share|improve this answer
mysqld_safe is a valid command. – womble Jul 5 '09 at 10:11
Thanks, I've corrected it. – Dennis Williamson Jul 5 '09 at 10:16
@Dennis: Why is there no period in the last command? – Masi Jul 5 '09 at 10:17
@Masi - because it's absolute path to binary executable. – pQd Jul 5 '09 at 10:18
I mean to like . /usr/... – Masi Jul 5 '09 at 10:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.