This might be a really stupid question so apologies in advance if this upsets anyone. I'm using mysql in git bash (tried cmd as well) and can't seem to figure out how to import a sql file I exported from VS code into mysql using the command prompt.
I tried all the solutions I could find here but it keeps giving me errors like this.
mysql> SOURCE C:/Users/smuf2/Downloads/person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE C:/Users/s muf2/Downloads/person.sql' at line 1
mysql> SOURCE C:\Users\smuf2\Downloads\person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE C:\Users\s muf2\Downloads\person.sql' at line 1
mysql> winpty mysql -u root -p test < 'C:/Users/smuf2/Downloads/person.sql' \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'winpty mysql -u r oot -p test < 'C:/Users/smuf2/Downloads/person.sql'' at line 1
mysql> winpty mysql -u root -p test < 'C:\Users\smuf2\Downloads\person.sql' \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'winpty mysql -u r oot -p test < 'C:\Users\smuf2\Downloads\person.sql'' at line 1
mysql> winpty mysql -u root -p test < C:/Users/smuf2/Downloads/person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'winpty mysql -u r oot -p test < C:/Users/smuf2/Downloads/person.sql' at line 1
mysql> winpty mysql -u root -p test < C:\Users\smuf2\Downloads\person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'winpty mysql -u r oot -p test < C:\Users\smuf2\Downloads\person.sql' at line 1
mysql> mysql -u root -p test < C:/Users/smuf2/Downloads/person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u roo t -p test < C:/Users/smuf2/Downloads/person.sql' at line 1
mysql> mysql -u root -p test < C:\Users\smuf2\Downloads\person.sql \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u roo t -p test < C:\Users\smuf2\Downloads\person.sql' at line 1
I've been learning postgres and can do this easily with \i filename but can't figure out why I can't do it in mysql. I'm using mysql 8.0.26.