The problem here is just a misunderstanding
Using --flush-logs with mysqldump simply closes and opens all files handles against the following:
In the case of binary logs, the current binary log is closed and a new binary log is open. In essence, it is the only log file that is numerically rotated For example, suppose you run SHOW MASTER STATUS;
and you see the binary log file names mysql-bin.000027
. Running FLUSH LOGS;
or FLUSH BINARY LOGS;
would close mysql-bin.000027
(which stops recording transactions to that file) and open mysql-bin.000028
(which now records incoming transactions).
However, rotation does not imply automatic deletion.
There are two ways to clean up the binary logs
DELETE ALL BINARY LOGS
If the DB Server is not used as MySQL Replication Master, then run
BINARY LOGGING IS ENABLED
mysql> RESET MASTER;
That will erase all binary logs and start with the first one (like mysql-bin.000001
)
BINARY LOGGING IS NOT ENABLED
Simply go the the OS and run the delete command (rm
for Linux,del
for Windows)
PURGE BINARY LOGS
If you want to keep binary logs from the last 48 hours, you run
mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 48 HOUR;
mysqld will erase all binary logs older than 48 hours.
AUTOMATIC PURGING
Simply set the following in my.cnf (or my.ini)
[mysqld]
expire_logs_days=2
Then, either restart mysqld or run the following as root
mysql> SET GLOBAL expire_logs_days = 2;
That way, every manual or automatic flush of binary logs will delete logs older than 2 days.
Once expire_logs_days is set, mysqldump will cleanup old logs every time it does --flush-logs.
Best Answer
You could load the mysql schema into the 5.6 instance and run
mysql_upgrade
. I have a much cleaner method in mind: You could dump the grants as pure SQL from the MySQL 5.5. instance and then run it in the MySQL 5.6 instance.You can do one of the following:
Once you create the script from the 5.5. instance, run the script in the 5.6 instance.
GIVE IT A TRY !!!
Note : I have a post where I helped someone manually fix
mysql.user
(MySQL service stops after trying to grant privileges to a user). Try this only when everything else fails ...