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

Detailed tutorial on installing SonarQube using Docker

Table of contents 1. Pull the image 1.1 Pull the ...

5 ways to achieve the diagonal header effect in the table

Everyone must be familiar with table. We often en...

CocosCreator classic entry project flappybird

Table of contents Development Environment Game en...

Analysis and application of irregular picture waterfall flow principle

The layout problem of irregular picture walls enc...

JavaScript Canvas implements Tic-Tac-Toe game

This article shares the specific code of JavaScri...

How to build php7 with docker custom image

First, perform a simple Docker installation. To c...

A brief analysis of how to upgrade PHP 5.4 to 5.6 in CentOS 7

1. Check the PHP version after entering the termi...

JavaScript to filter arrays

This article example shares the specific code for...

JavaScript String Object Methods

Table of contents Methods of String Object Method...

Detailed explanation of Javascript string methods

Table of contents String length: length charAt() ...

Beginners learn some HTML tags (3)

Beginners who are exposed to HTML learn some HTML...

js realizes horizontal and vertical sliders

Recently, when I was doing a practice project, I ...

Design of image preview in content webpage

<br />I have written two articles before, &q...

Basic knowledge of HTML: a preliminary understanding of web pages

HTML is the abbreviation of Hypertext Markup Langu...