您好,登录后才能下订单哦!
小编给大家分享一下MySQL 报错'Variable 'XXX' is a read only variable'怎么办,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
设置参数时报错
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
看完了这篇文章,相信你对“MySQL 报错'Variable 'XXX' is a read only variable'怎么办”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。