'<' operator is reserved PowerShell Error

21,972

Solution 1

How about

 & cmd.exe /c "mysql -u root -p Tutorials < tut_backup.sql" 

Solution 2

You can pipe in the contents like so:

Get-Content tut_backup.sql | mysql -u root -p Tutorials

Solution 3

Try this instead:

mysql -u root -p
(prompts for password)
source tut_backup.sql

Credit goes to wallyk.

Share:
21,972
Concerned_Citizen
Author by

Concerned_Citizen

Walking pumpkin pie. You're helping in SO by answering questions or by posing thoughtful questions. Remember, others (or you later on) will be looking at them for help.

Updated on January 03, 2020

Comments

  • Concerned_Citizen
    Concerned_Citizen over 4 years

    I am trying to use mysql -u root -p Tutorials < tut_backup.sql in PowerShell to restore a table in a MySQL DB but it's giving me The '<' operator is reserved for future use. error. Is there a roundabout way?