Error when using mysqldump to create data snapshot

0
mysqldump -h source_MySQL_DB_instance_endpoint \
    -u user \
    -ppassword \
    --port=3306 \
    --single-transaction \
    --routines \
    --triggers \
    --databases  database database2 > path/rds-dump.sql

mysqldump: Couldn't execute 'FLUSH TABLES WITH READ LOCK': Access denied for user 'admin'@'%' (using password: YES) (1045)

My user has the highest permissions. Why is an error reported? I added permissions

GRANT RELOAD, LOCK TABLES ON *.* TO 'admin'@'%';
FLUSH PRIVILEGES;

will still report an error

Engine MySQL Community

Engine version 8.0.35

DD-Boom
asked 24 days ago91 views
1 Answer
0

Hello.

I think the following stackoverflow answers will be helpful.
Try adding "--set-gtid-purged=off" to the command option.
https://stackoverflow.com/questions/77239724/amazon-rds-mysql-couldnt-execute-flush-tables-with-read-lock

mysqldump -h source_MySQL_DB_instance_endpoint \
    -u user \
    -ppassword \
    --port=3306 \
    --single-transaction \
    --routines \
    --triggers \
    --set-gtid-purged=off \
    --databases  database database2 > path/rds-dump.sql
profile picture
EXPERT
answered 24 days ago
profile picture
EXPERT
reviewed 22 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions