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.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.