ITPub博客

首页 > 数据库 > MySQL > Innodb Read Only Mode

Innodb Read Only Mode

MySQL 作者:mikeliuy 时间:2014-10-11 11:49:48 0 删除 编辑

Innodb has come up (in mysql-5.6.7 release candidates onwards) with changes for running server instance in read only mode. It makes entire server instance as read only. You cannot selectively make certain table as read only (Not at table level). Feature is introduced by considering

(1) Innodb can be run from read only media like DVD/CD etc

(2) User can explicitly set instance in read only mode though its on read-write media

Start server in Read Only Mode:

"--innodb-read-only" boolean configuration parameter is introduced  for starting server in read only mode. Server will not start in read only mode if it was not shutdown cleanly/safely earlier. 

User must pass/set parameter which try to create file/log on read/write media. Else server will not start. Like , user will need to pass "--pid-file=" and/or "--event-scheduler=disabled"  if datadir is on read only media etc

There exits a "--read-only" variable which differs from newly added --innodb-read-only.[If datadir is without write permission then server will give error even when --read-only option is provided ]

--read-only
1) When datadir is RW and server started with --read-only :  root/super user have permission for operations. Other users will not have permission to change.
2) When datadir is on read only media and server started with --read-only : all operations blocked for users (including root).

--innodb-read-only
1) When datadir is RW and server started with --innodb-read-only : 
a) No user will be able to modify.  DCL(like create user/grant/revoke etc) commands will work for root user. (It's non innodb issue)
b) When both  --read-only and --innodb-read-only are given, then --innodb-read-only takes effect.(As I checked that root user can not do DML/DDL but can perform DCL )
2) When datadir is on read only media and server started with --read-only : all operations blocked for users (including root).

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26812308/viewspace-1295097/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-06-18

  • 博文量
    72
  • 访问量
    420994