mysql server is running with the skip grant tables option

  • 2021-09-05 01:08:56
  • OfStack

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
It seems that MYSQL is still running in--skip-grant-tables mode, how to get it back to the original mode

Method 1: skip-grant-tables was originally configured in the mysql. ini file, and just add a # comment in front of it

Modify the configuration file of mysql and put skip-grant-tables After removal, restart mysql

Type 2:

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

Solution:

mysql > set global read_only=0;
(Turn off the read-only property of the new main library)

flush privileges;

set global read_only=1; (Read and Write Properties)

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';

Explanation:

set global read_only=0; Turn off read-only, you can read and write
set global read_only=1; Start read-only mode


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; Turn off read-only, you can read and write set global read_only=1; Start read-only mode


Related articles: