mysql server is running with the --skip-grant-tables option

时间:2021-05-24

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
意思貌似MYSQL还运行在 --skip-grant-tables模式,如何让他回到原来的模式

第一种方法:原来在mysql.ini文件中配置了skip-grant-tables,前面加个#注释掉就可以了

修改mysql的配置文件,把skip-grant-tables去掉后,重启mysql

第二种:

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

解决办法:

mysql> set global read_only=0;
(关掉新主库的只读属性)

flush privileges;

set global read_only=1;(读写属性)

flush privileges;

Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

mysql> SET SESSION binlog_format = 'ROW';
mysql> SET GLOBAL binlog_format = 'ROW';

解释:

set global read_only=0; 关闭只读,可以读写
set global read_only=1; 开始只读模式

mysql> set global read_only=0; Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%read_only%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | innodb_read_only | OFF | | read_only | OFF | | tx_read_only | OFF | +------------------+-------+ 3 rows in set (0.00 sec) mysql> set global read_only=1; Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%read_only%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | innodb_read_only | OFF | | read_only | ON | | tx_read_only | OFF | +------------------+-------+ 3 rows in set (0.00 sec)

set global read_only=0; 关闭只读,可以读写 set global read_only=1; 开始只读模式

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章