mysqldump: Got error: 1: Can't create/write to file '/usr/local/mysql/data/bak/t4.txt' (Errcode: 13

来源:互联网 发布:linux top 进程状态 编辑:程序博客网 时间:2024/06/05 22:41

在向目录中导出文件时,有时候会提示下面错误

[root@localhost data]# mysqldump -uroot -p123456 test2 t4 -T  ./bak/

Warning: Using a password on the command line interface can be insecure.

mysqldump: Got error: 1: Can't create/write to file '/usr/local/mysql/data/bak/t4.txt' (Errcode: 13 - Permission denied) when executing 'SELECT INTO OUTFILE'

报出此错是由于目录没有足够权限导致,只需给目录足够权限即可

[root@localhost data]# chown mysql:mysql ./bak/
[root@localhost data]# mysqldump -uroot -p123456 jiaowu tutors -T ./bak/

Warning: Using a password on the command line interface can be insecure.


0 0