MariaDB [(none)]> show binary logs; 1381 - You are not using binary logging
MariaDB [(none)]> show variables like 'log_bin'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_bin | OFF | +---------------+-------+
错误原因:测试环境中部署的实例没有开启bin log
MariaDB [(none)]> set global log_bin_trust_function_creators=1;
MariaDB [(none)]> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+ | Variable_name | Value | +---------------------------------+-------+ | log_bin_trust_function_creators | ON | +---------------------------------+-------+
[root@mariadb bin]# mysqlbinlog –no-defaults mysql-bin.00001; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; mysqlbinlog: File '' not found (Errcode: 2)
DELIMITER ;
# End of log file ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;