as the title show, I don't know how to achieve it in an effective way.
the command show slave status only shows the binlog file name and position corresponding to master instead of slave.
One way to do is to use command show binary logs to get the latest row's Log_name, and then use command show binlog events in '{Log_name}' to get the latest row's Pos. But that's isn't effective, because I only to want to get the latest row for above commands.
Are there any more effective ways to achieve it?
In MySQL you have to loop over the result set from
SHOW BINARY LOGS. The names of the binary logs are stored in an index file, but not in INFORMATION_SCHEMA or PERFORMANCE_SCHEMA.When executing
SHOW BINARY LOGSMySQL reads and process the binary log index file in your data directory. It's usually namedhostname-bin.index.MariaDB stores the latest binary log file and position in status variables
binlog_snapshot_file/position, however this is not supported in MySQL.