MySQL – Creating a mysql.cnf File for Import

MySQL

I have created a config file for dumping .sql with no password prompt, is it possible to do this when using import?

I have read somewhere to just add on the cnf file "mysqlimport" then the credential details, but gets me back with an mysql error code 2000 'user'@'localhost' access denied, using password (NO).

I also tried granting this user access, but no success. This user is different from the user I use for sql dumps.

This is how I run the import command:

mysqlimport --defaults-extra-file=~/.mysql/mysqlimport.cnf reports < /tmp/testdump.sql 

error message is

ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO)

Best Answer

I've decided to not use the cnf file, instead I used .yaml in solving this.

Thanks for answering.