在向目录中导出文件时,有时候会提示下面错误
[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.