0

I need to purge binary logs from mysql version 4. I have checked the manual found that the syntax is like an advanced versions:

PURGE MASTER LOGS TO mysql-bin.xxx

However, when i use this command, i get the following error:

ERROR 1064 (00000): 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 'BINARY LOGS TO 'mysql-bin.xxx'' at line 1

Please avdise.

1
  • 4.0 pre-dates CHARACTER SET support, plus lots of other things. It will be nontrivial to upgrade, which you should do. If you have SELECTs that mix JOIN and LEFT JOIN, add parentheses now; there is an incompatible change coming.
    – Rick James
    Mar 31, 2017 at 3:56

1 Answer 1

1

The error message says right syntax to use near 'BINARY LOGS TO 'mysql-bin.xxx' but you mentioned use of PURGE MASTER LOGS TO ...?

Try using PURGE MASTER LOGS TO mysql-bin.xxx instead of using 'PURGE BINARY ....' as the latter was added to MySQL v4.1.1 and if your version is any lower, PURGE BINARY ... won't work.

5
  • I still get the same message. I entered PURGE MASTER LOGS TO mysql-bin.001 and got: ERROR 1064 (00000): 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 'mysql-bin.001' at line 1.
    – Omri
    Mar 28, 2017 at 14:16
  • Can you post result of running SELECT version() on MySQL Client?
    – thatsaru
    Mar 28, 2017 at 14:17
  • 4.0.27-standard-log
    – Omri
    Mar 28, 2017 at 14:18
  • Also, are you using single quotes around the mysql-bin.001? So the command should be like PURGE MASTER LOGS to 'mysql-bin.xxx'
    – thatsaru
    Mar 28, 2017 at 14:18
  • Thanks. The command PURGE MASTER LOGS worked with single quotes.
    – Omri
    Mar 28, 2017 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.