Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am currently working on mySQL 5.6.10 server and RHEL 6.2. I need to set the system variable PATH for mySQL on RHEL 6.2 Terminal. How do I set it?

I also want to run a .sql file on Linux. I am using the following command:

mySQL DBname -uusername -ppassword <"path to the .sql file"

Please help me with the correct command to run the sql script file on Linux. If there are any prerequisites or configurations required to run the .sql file?

share|improve this question
1  
This appears to be a horrible XY Problem. The question is supposedly about setting the PATH variable, but the real problem is apparently the capitalization of the mysql command. –  depquid Apr 4 '13 at 14:55

1 Answer 1

I'm not exactly sure what you are asking. First of all, the mysql command is all lowercase:

mysql DBname -uusername -ppassword <"path to the .sql file"

Also, the database name is case-sensitive, so make sure you have that correct as well.

To add a path to the PATH environment variable, use

export PATH=$PATH:/path/to/add

where /path/to/add is the path containing the binary you want to run.

But the path for the MySQL client executable should already be added. If you got a command not found error, most likely it's because you used uppercase letters in the command name.

share|improve this answer

Your Answer

 
discard

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.