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

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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值