[MDEV-14775] mysqladmin flush commands not working Created: 2017-12-26  Updated: 2020-08-25  Resolved: 2017-12-27

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.0.32
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Claudio Nanni Assignee: Unassigned
Resolution: Not a Bug Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-14774 Mysqladmin manual page missing some c... Closed

 Description   

I noticed that:

mysqladmin --flush-logs
mysqladmin --flush-error-log
mysqladmin --refresh
mysql -e "FLUSH LOGS"

Don't flush the error log and:

mysqladmin --flush-binary-log

Doesn't rotate the binary logs

While FLUSH LOGS; run interactively does rotate logs(error and binary).

This is confirmed also by strace.

To reproduce it's simple:

$ mv error.log error.log.1
$ mysqladmin flush-error-log # or any other of the above commands

error.log is not re-created

You can confirm it with strace by:

 $ strace -f -e trace=%file -p `pidof mysqld` -o mysqld.strace 

After running the commands mysqld.strace file will be empty:

 $ more mysqld.strace 

If you do the same using:

 $ mysql -e "FLUSH LOGS;" 

Then the strace file will contain the proper system calls.



 Comments   
Comment by Elena Stepanova [ 2017-12-26 ]

Both seem to be working for me.

$ bin/mysqld_safe --log-bin=mdev14775-bin &
$ ls -l data/mdev14775-bin*
-rw-rw---- 1 elenst elenst 316 Dec 26 19:44 data/mdev14775-bin.000001
-rw-rw---- 1 elenst elenst  23 Dec 26 19:44 data/mdev14775-bin.index
..
$ bin/mysqladmin flush-binary-log -uroot
$ ls -l data/mdev14775-bin*
-rw-rw---- 1 elenst elenst 363 Dec 26 19:44 data/mdev14775-bin.000001
-rw-rw---- 1 elenst elenst 359 Dec 26 19:44 data/mdev14775-bin.000002
-rw-rw---- 1 elenst elenst  46 Dec 26 19:44 data/mdev14775-bin.index

$ bin/mysqladmin flush-error-log -uroot
..
8400  open("/data/releases/10.0.32/data/ws.err", O_WRONLY|O_CREAT|O_APPEND, 0666) = 19
8400  open("/data/releases/10.0.32/data/ws.err", O_WRONLY|O_CREAT|O_APPEND, 0666) = 19
8400  +++ exited with 0 +++

Please provide more details on how exactly yous start the server.

Comment by Claudio Nanni [ 2017-12-27 ]

Apologies, you can close or even delete this issue as it's non-existing.
I mixed up two instances (executing on one, checking on another), mysqladmin works perfectly.

Generated at Thu Feb 08 08:16:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.