Innodb Read Only Mode

mikeliuy發表於2014-10-11

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部落格 ” ,連結:http://blog.itpub.net/26812308/viewspace-1295097/,如需轉載,請註明出處,否則將追究法律責任。

相關文章