0xSina
0xSina

Reputation: 21553

mysql: command not found but it is in my PATH

.bashrc says:

PATH=$PATH:/usr/local/mysql/bin/:$HOME/.rvm/bin # Add RVM to PATH for scripting

but mysql -u root returns

-bash: mysql: command not found

but if I do /usr/local/mysql/bin/mysql -u root everything works fine. Why isn't it search using PATH?

Thanks

Upvotes: 0

Views: 1793

Answers (1)

cdhowie
cdhowie

Reputation: 169008

You need to either use:

export PATH=$PATH:...

Or add the export PATH statement after this statement.

The changes you are making are not surviving beyond the execution of your .bashrc. Adding export before your assignment (or export PATH) later will ensure that your changes are exported to your shell's child processes.

Upvotes: 1

Related Questions