mysql Error 1045 with the command LOAD DATA
in mysql command LOAD DATA
produces error message ERROR 1045 (28000): Access denied for user 'user1' @ 'localhost' (using password: YES)
solution
to set the root mysql GRANT command FILE
mysql> use db1
(database name)
mysql> grant file on *.* to user1 @ localhost IDENTIFIED BY 'mypassword';
(use your username and password to assign permissions)
NB: the file containing the data to be loaded should be placed in the database directory of MySQL; If you want to use a file in the user's local directory, you must add the clause in the command LOAD LOCAL DATA:
Example:
mysql> load data infile local "data.txt" INTO TABLE movim fields terminated by ', ';
0 comments:
Post a Comment