I'm stuck trying to run a mysql statement from a file - seems if I'm outside the cd usr/local/mysql/bin directory - I get a mysql command not found error, and if I'm inside it, it can't find the path to the mysql file. The mysql file is currently in my user folder. I'm supposed to be running a command like:
mysql -u user -phpuser password < path/to/file.sql
Anybody know how to get this working?
If mysql is in /usr/local/mysql/bin rather than /usr/local/bin then update your PATH:
export PATH=$PATH:/usr/local/mysql/bin
In your question, you have a dash in front of the username, try:
mysql --user=phpuser --password=password < /path/to/file.sql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With