在my.cnf加个read-only也好,启动的时候加个--read-only也罢,结果都可以随意地update数据表中的内容!如何才能使数据库只读呢?

解决方案 »

  1.   

    我登陆的用户有super权限,估计是这个原因!
      

  2.   

    嗯, 我新建了个帐户,只具备 SELECT, DELETE, UPDATE 这几个权限,
    此时update的时候会报错,说是加了只读参数!
    如果在加上super,则可随意更新插入删除!
      

  3.   

      --read_only         Make all non-temporary tables read-only, with the
                          exception for replication (slave) threads and users with
                          the SUPER privilege
    权限“SUPER”的上下文是属于“服务器管理”的,当然有可随意更新插入删除!