mysqldump: Error: ‘Can’t create/write to file ‘/var/tmp/#xxxx.MAI’ (Errcode: 13)’ when trying to dump tablespaces
mysqldump -uxxxx -p test >test_20210830.sql
Mariadb DB导出备份报错:
[root@host-03-centos backup]# !mysqld
mysqldump -utest -p test > test_20210826.sql
Enter password:
mysqldump: Error: ‘Can’t create/write to file ‘/var/tmp/#sql_6a1e_2.MAI’ (Errcode: 13)’ when trying to dump tablespaces
mysqldump: Couldn’t execute 'show fields from archive
': Can’t create/write to file ‘/var/tmp/#sql_6a1e_0.MAI’ (Errcode: 13) (1)
登录数据库查看tmp目录:
MariaDB [(none)]> show variables like ‘%tmp%%’;
±------------------±---------+
| Variable_name | Value |
±------------------±---------+
| max_tmp_tables | 32 |
| slave_load_tmpdir | /var/tmp |
| tmp_table_size | 16777216 |
| tmpdir | /var/tmp |
±------------------±---------+
查看/var/tmp