Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我被困在试图从文件运行 mysql 语句 - 似乎如果我在 cd usr/local/mysql/bin 目录之外 - 我得到一个 mysql command not found 错误,如果我在其中,它可以'找不到mysql文件的路径。mysql 文件当前位于我的用户文件夹中。我应该运行如下命令:
mysql -u user -phpuser password < path/to/file.sql
有人知道如何让这个工作吗?
如果mysql在/usr/local/mysql/bin而不是/usr/local/bin然后更新您的PATH:
mysql
/usr/local/mysql/bin
/usr/local/bin
PATH
export PATH=$PATH:/usr/local/mysql/bin
在您的问题中,您的用户名前面有一个破折号,请尝试:
mysql --user=phpuser --password=password < /path/to/file.sql