mysql client之init-command


If the server is a replication master and you want to avoid replicating the content to replication slaves, use this command:

mysql --init-command="SET sql_log_bin=0" mysql < file_name


[root@localhost backup]# mysql -f --init-command='set sql_log_bin=0' < test.sql
ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.









原文地址:https://www.cnblogs.com/DataArt/p/10222567.html