내용으로 건너뛰기

Mysqldump error in Aurora RDS

1

When I execute:

mysqldump --ssl-verify-server-cert=false -h xxxxx-mysql-main.cluster-yyy.eu-west-2.rds.amazonaws.com -u root -p databasename > output.sql

I receive the next error:

mysqldump: Couldn't execute '/*!100100 SET @@MAX_STATEMENT_TIME=0.000000 */': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 SET @@MAX_STATEMENT_TIME=0.000000 */' at line 1 (1064)

What's the problem?

질문됨 2년 전1.7천회 조회

2개 답변
3

Hello Miguel!

The error you're encountering is related to the use of @@MAX_STATEMENT_TIME which is not recognized or supported in your MySQL version or Aurora MySQL setup. This might be due to differences in the MySQL version compatibility or a specific feature set in Aurora MySQL.

Here's how you can resolve the issue:

  1. Update mysqldump Utility: Ensure that you are using the latest version of the mysqldump utility. An outdated version might not be fully compatible with your Aurora RDS instance.

  2. Disable MAX_STATEMENT_TIME: You can disable the MAX_STATEMENT_TIME by adding the --set-gtid-purged=OFF and --skip-max-statement-time options to your mysqldump command. These options will skip the problematic setting.

    Here’s the updated command:

    mysqldump --ssl-verify-server-cert=false -h xxxxx-mysql-main.cluster-yyy.eu-west-2.rds.amazonaws.com -u root -p --set-gtid-purged=OFF --skip-max-statement-time databasename > output.sql
  3. Check MySQL Version Compatibility: Verify the MySQL version of your Aurora RDS instance and ensure that it is compatible with the mysqldump utility you are using. You can check the version by running:

    SELECT VERSION();

    Adjust your mysqldump options based on the specific version of MySQL or Aurora MySQL you are using.

  4. Additional Compatibility Options: If the issue persists, you might consider using additional compatibility options provided by mysqldump. For instance, the --compatible option can be used to specify the target MySQL version or server:

    mysqldump --ssl-verify-server-cert=false -h xxxxx-mysql-main.cluster-yyy.eu-west-2.rds.amazonaws.com -u root -p --compatible=mysql40 databasename > output.sql

By making these adjustments, you should be able to avoid the SQL syntax error related to @@MAX_STATEMENT_TIME and successfully perform the mysqldump.

Feel free to ask if you have any further questions or need more assistance!


전문가

답변함 2년 전

AWS
전문가

검토됨 2년 전

전문가

검토됨 2년 전

  • Neither.

    1. I have one of the latest versions in Archlinux (10.19).
    2. Both arguments fail: "unknown variable 'set-gtid-purged=OFF'".
    3. 8.0.30.
    4. It fails aswell: "Couldn't execute '/*!40100 SET @@SQL_MODE='MYSQL40' */': Variable 'sql_mode' can't be set to the value of 'MYSQL40'"
1

Never managed to solve it in my machine. So I created an EC2 with Amazon Linux 2023. Then I installed the client:

sudo dnf install mariadb105
mariadb-dump -h xxxxx-mysql-main.cluster-yyy.eu-west-2.rds.amazonaws.com -u root -p databasename > output.sql

It works.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠