您好,登錄后才能下訂單哦!
小編給大家分享一下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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。