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.
我有一个场景,其中我有一个目录中的 sql 文件列表。我需要遍历所有文件并在 mysql 数据库中执行。这可以使用 node.js 或 mysql 本身来完成。有什么建议么?
这是一个可以帮助您入门的 bash 命令:
for f in *.sql ; do mysql < "$f" ; done
如果不是本地主机,请确保添加您的 mysql 连接信息。