ITPub博客

首页 > 数据库 > MySQL > MySQL 报错'Variable 'XXX' is a read only variable'

MySQL 报错'Variable 'XXX' is a read only variable'

原创 MySQL 作者:feelpurple 时间:2017-03-13 18:39:05 0 删除 编辑
设置参数时报错
mysql> set global secure_file_priv='/database/percona';
ERROR 1238 (HY000): Variable 'secure_file_priv' is a read only variable

报错原因:
参数为只读参数,需要在配置文件中更改该参数,之后重启数据库

[mysql@localhost percona]$ bin/mysqladmin -uroot -S /u01/mysql_data/mysql.sock shutdown -p
Enter password:
2017-03-13T10:38:21.340514Z mysqld_safe mysqld from pid file /u01/mysql_data/localhost.localdomain.pid ended
[1]+  Done                    bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf
[mysql@localhost percona]$ vim /u01/mysql_data/my.cnf
[mysqld]
secure_file_priv='/database/percona'

[mysql@localhost percona]$ bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf &
[1] 28543
[mysql@localhost percona]$  mysqld_safe Adding '/database/percona/lib/mysql/libjemalloc.so.1' to LD_PRELOAD for mysqld
2017-03-13T10:46:33.142327Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.143853Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.166624Z mysqld_safe Starting mysqld daemon with databases from /u01/mysql_data

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

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

注册时间:2014-08-01

  • 博文量
    404
  • 访问量
    1673950