MYSQL IMPORT USING DB < .sql giving Syntax error

611 Views Asked by At

MYSQL import using DB < .sql

I'm using is this

mysql.exe -u DBCREATE --exec="ts3hosting_20  < b3.sql;"

is giving this syntax error:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the ma nual that corresponds to your MySQL server version for the right syntax to use near 'ts3hosting_20 < b3.sql' at line 1

Any Suggestions?

I'm using mysql on windows with MYSQL 5.5.32

1

There are 1 best solutions below

0
On

Don't know how you came up with that syntax, but it's actually

mysql -u yourUserName -poptionallyYourPassword_no_space_here_if_you_specify_one -h localhostOrWhatever yourDatabaseName < b3.sql

If you set a password for your user, you have to add -p parameter, regardless if you specify it on command line or in virtual mode.