MySQL Import

Hi Experts,

I am trying to do a MySQL import, but I am getting an error
mysql> mysqlimport  --ignore-lines=1 --fields-terminated-by=, --local -u root -p12345 css_reservations "D:\reservations.csv";
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 'mysqlimport  --ignore-lines=1 --fields-terminated-by=, --local -u root -p12345 c' at line 1
mysql> mysqlimport  --ignore-lines=1 --fields-terminated-by=, --local css_reservations "D:\reservations.csv";
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 'mysqlimport  --ignore-lines=1 --fields-terminated-by=, --local css_reservations ' at line 1
mysql>

Open in new window


As you can see, I am trying to do this while being logged into my MySQL, but if I try to do it without being logged in it works. However, the reason why I want to be logged in is because, when the import works I get a lot of warnings (2,509,212 and 26,451 skipped), which I cannot see.

If I have two command window open, when I am logged in to the one and from the other I do the import, if I go back to the first window where I am logged in and show warnings, I get an empty set.

Thank you
APD TorontoSoftware DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
'mysqlimport' is an external program, not a part of the 'mysql' command line program.  As it says here https://dev.mysql.com/doc/refman/5.6/en/mysqlimport.html 
The mysqlimport client provides a command-line interface to the LOAD DATA INFILE SQL statement.
You can not use it inside 'mysql' command line program.  You can however use the equivalent SQL commands shown here: https://dev.mysql.com/doc/refman/5.6/en/load-data.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.