发布于 2017-08-13 10:58:54 | 128 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Mysql教程,程序狗速度看过来!

Mysql关系型数据库管理系统

MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司。MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。


今天在mysql中新建数据库提示The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement,原来是数据中配置的--skip-grant-tables,这样安全就降低了,这个一般当忘记root密码的时候需要这样操作

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; 开始只读模式



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务