mysql server is running with the --skip-grant-tables option
TheMySQLserverisrunningwiththe--skip-grant-tablesoptionsoitcannotexecutethisstatement
意思貌似MYSQL还运行在--skip-grant-tables模式,如何让他回到原来的模式
第一种方法:原来在mysql.ini文件中配置了skip-grant-tables,前面加个#注释掉就可以了
修改mysql的配置文件,把skip-grant-tables去掉后,重启mysql
第二种:
TheMySQLserverisrunningwiththe--skip-grant-tablesoptionsoitcannotexecutethisstatement
解决办法:
mysql>setglobalread_only=0;
(关掉新主库的只读属性)
flushprivileges;
setglobalread_only=1;(读写属性)
flushprivileges;
Cannotexecutestatement:impossibletowritetobinarylogsinceBINLOG_FORMAT=STATEMENTandatleastonetableusesastorageenginelimitedtorow-basedlogging.InnoDBislimitedtorow-loggingwhentransactionisolationlevelisREADCOMMITTEDorREADUNCOMMITTED.
mysql>SETSESSIONbinlog_format='ROW';
mysql>SETGLOBALbinlog_format='ROW';
解释:
setglobalread_only=0;关闭只读,可以读写
setglobalread_only=1;开始只读模式
mysql>setglobalread_only=0; QueryOK,0rowsaffected(0.00sec) mysql>showvariableslike'%read_only%'; +------------------+-------+ |Variable_name|Value| +------------------+-------+ |innodb_read_only|OFF| |read_only|OFF| |tx_read_only|OFF| +------------------+-------+ 3rowsinset(0.00sec) mysql>setglobalread_only=1; QueryOK,0rowsaffected(0.00sec) mysql>showvariableslike'%read_only%'; +------------------+-------+ |Variable_name|Value| +------------------+-------+ |innodb_read_only|OFF| |read_only|ON| |tx_read_only|OFF| +------------------+-------+ 3rowsinset(0.00sec)
setglobalread_only=0;关闭只读,可以读写setglobalread_only=1;开始只读模式