0

I am trying to dump tables in tsv file but it shows an error

ERROR 1045 (28000): Access denied for user 'user'@'host' (using password: YES)

my command:

mysql -u$DBUser -p$DBPass -D $DBName -e "LOAD DATA INFILE 'file.tsv' INTO TABLE <table>"

My privleges:

Privleges

enter image description here

gen14
  • 11
  • 1

2 Answers2

0

When you connect, verify that the "host" seen from the server (in your error message it's just "'host'") is the same for the GRANTs. Here, it must be "localhost". If it is not, then you must add a GRANT for user@whateverappearsintheerrormessage .

(After granting privileges, you must issue the FLUSH PRIVILEGES command).

However, your user probably does not have the FILE global privilege, without which the LOAD DATA INFILE command will not work. See this answer for example.

LSerni
  • 53,899
  • 9
  • 63
  • 106
0

instead of: LOAD DATA INFILE

use: LOAD DATA LOCAL INFILE

gen14
  • 11
  • 1
  • And how would solve that the problem that you can't login? The error message clearly states, that you can't connect to MariaDB server due to providing wrong credentials. – Georg Richter Mar 25 '21 at 06:43
  • Yes. weird but the credentials were correct. I don't know how but it solved problem, I think MySQL should return more meaningful error message – gen14 Mar 25 '21 at 16:35