troubleshooting Question

Attempting to import data to Mysql using mysqlimport

Avatar of donpick
donpick asked on
MySQL ServerDatabases
6 Comments2 Solutions180 ViewsLast Modified:
Running MySql version 5.6.17 on a ML350 G5 server.  The operating system is Small Business Server 2008

Please understand I am learning Mysql .  I am not an expert.

I am trying to import a text file using mysqlimport utility.  

The command is below:
mysqlimport --user=root –password=dbxxx --fields-terminated-by=”,”   --lines-terminated-by=”\n” pivot D:\Invest-Import-Data\tblpivottxt.txt

The problem:
When I put the above command into a batch file mysql displays the error:
    “Error 1045 Access denied for user 'root @ localhost' (using password NO)

So I created a batch file which would change directory to the path where mysql exists .  The path is:
  c:\program files\Mysql\Mysql server 5.6\bin
Then I manually typed the mysqlimport command above and the data successfully  imported

Questions:
Q1.)  I have attached the batch file and the txt file and the table structure.  What changes would you make to this batch file so I don't have to manually type the mysqlimport command?

Q2.)  What must I do so the password does not have to be entered as part of the mysqlimport command?

Please give detailed answers.  I am not a mysql expert.
Useful links are always appreciated.

Thank you for your help.
tblpivottxt.txt
Mysql-Import.txt
tblpivottxt-structure.png
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 2 Answers and 6 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 2 Answers and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004