mysqlimport: Error: 1227 Access denied with MySQL 8.0 and Amazon RDS
Asked Answered
R

2

10

We are using MySQL 8.0.* and .csv file for the importing data into Amazon RDS. We are executing this command from the app server command line.

Error:

mysqlimport: Error: 1227 Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation

Command:

mysqlimport --local --compress --columns='col1,col2,col3,col4' -h dbhost -u dbusername -pdbpassword dbname --fields-terminated-by='|' file_path/table_name.csv

We have already provided DBA permission to DB user.

Rutherfordium answered 5/6, 2019 at 8:54 Comment(0)
C
13

As error suggests, the user you are running import command not having permissions SESSION_VARIABLES_ADMIN.

You could setup it like below.

GRANT SESSION_VARIABLES_ADMIN ON *.* TO 'user'@'%';

OR

GRANT SESSION_VARIABLES_ADMIN ON *.* TO 'user'@'specific-host';

It should resolve the issue.

Collude answered 6/6, 2019 at 15:55 Comment(2)
I get 'You are not allowed to create a user with Grant'.Urien
@Urien you may need to ask your database administrator to run this command for you.Collude
K
-1

Comment out the parameters TEMP_LOG_BIN and GTID_PURGED in the mysql dump and save. Try to import the dump file in target DB. It should work.

Koheleth answered 4/11, 2020 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.