mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it can

来源:互联网 发布:又拍云存储 域名 编辑:程序博客网 时间:2024/06/08 10:24
root@mysqlcentos01 evis]# mysqldump -uroot -S /tmp/mysql3306.sock -pevis123 test salary  -T .
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events. 
SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
SET @@SESSION.SQL_LOG_BIN= 0;
--
-- GTID state at the beginning of the backup 
--
SET @@GLOBAL.GTID_PURGED='8b3a2bfc-5ff9-11e7-a6aa-080027f004fe:1-138';
mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement when executing 'SELECT INTO OUTFILE'

[root@mysqlcentos01 evis]# 

查看参数--secure-file-priv

root@localhost [test]>show global variables like '%secure%'; 
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| require_secure_transport | OFF   |
| secure_auth              | ON    |
| secure_file_priv         | /tmp/ |
+--------------------------+-------+
3 rows in set (0.01 sec)
root@localhost [test]>

secure_file_priv的值为/tmp/ ,表示限制导入|导出只能发生在/tmp/目录下

修改参数:

[root@mysqlcentos01 evis]# mysqladmin -S /tmp/mysql3306.sock shutdown -p
Enter password: 
[root@mysqlcentos01 evis]# vi /data/mysql/mysql3306/my3306.cnf 

[mysqld]
#file
secure-file-priv=

[root@mysqlcentos01 evis]# mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf  &
[1] 10179
[root@mysqlcentos01 evis]# 



阅读全文
0 0
原创粉丝点击