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

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

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 can I get it back to the original mode?

The first method: Skip-grant-tables is configured in the mysql.ini file. Just add a # in front of it and comment it out.

Modify the mysql configuration file, remove skip-grant-tables , and restart mysql

Second type:

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 attribute of the new master database)

flush privileges;

set global read_only=1; (read-write attribute)

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

explain:

set global read_only=0; turn off read-only, 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, can read and write set global read_only=1; start read-only mode

You may also be interested in:
  • The MySQL server is running with the --read-only option so it cannot execute this statement
  • mysql databasemysql: [ERROR] unknown option ''--skip-grant-tables''
  • Detailed explanation of ensuring the consistency of MySQL views (with check option)
  • Solution to the error message "java.sql.SQLException: Incorrect string value:'\xF0\x9F\x92\xA9\x0D\x0A...'" when storing emoticons in MySQL
  • NULL and Empty String in Mysql
  • An example of connecting mysql with php via odbc to any database
  • Detailed explanation of installing and completely uninstalling mysql with apt-get under Ubuntu
  • Examples of the correct way to use AES_ENCRYPT() and AES_DECRYPT() to encrypt and decrypt MySQL
  • Detailed explanation of using pt-heartbeat to monitor MySQL replication delay
  • Introduction to the use of MySQL pt-slave-restart tool

<<:  How to use cutecom for serial communication in Ubuntu virtual machine

>>:  Vue3.0 routing automatic import method example

Recommend

How to install ROS Noetic in Ubuntu 20.04

Disclaimer: Since the project requires the use of...

Optimization methods when Mysql occupies too high CPU (must read)

When Mysql occupies too much CPU, where should we...

Detailed explanation of Linux rpm and yum commands and usage

RPM package management A packaging and installati...

Detailed explanation of the spacing problem between img tags

IMG tag basic analysis In HTML5, the img tag has ...

How to solve the Mysql transaction operation failure

How to solve the Mysql transaction operation fail...

Implementing custom scroll bar with native js

This article example shares the specific code of ...

Nginx cache configuration example

When developing and debugging a web application, ...

HTML displays ellipsis beyond the text... implemented through text-overflow

You need to apply CSS to div or span at the same t...

React realizes the whole process of page watermark effect

Table of contents Preface 1. Usage examples 2. Im...

Draw a heart with CSS3

Achieve resultsRequirements/Functionality: How to...

Docker installation and deployment of Net Core implementation process analysis

1. Docker installation and settings #Install Cent...