【发布时间】:2022-01-09 19:02:45
【问题描述】:
我正在尝试在 Windows Powershell 中导入一个 dumpfile.sql:
mysql -u root -p --database=database < Backup.sql
但我收到以下错误:
At <script-path>:1 char:34
+ mysql -u root -p --database=database < Backup.sql
+ ~
The '<' operator is reserved for future use..
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported
如果我试图逃避“
mysql -u root -p --database=database ^< Backup.sql
我只得到所有选项的列表。
问题可能是由于更新到 Windows 11 造成的。
【问题讨论】:
-
请尝试用英文发布错误信息。顺便说一句:
^仅在cmd.exe中用作转义字符,而不在 PowerShell 中(它是`,即所谓的反引号)。