第一步:
/opt/lampp/bin/mysql 回车
mysql> show variables like 'tmpdir';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| tmpdir | /tmp |
+---------------+-------+
1 row in set (0.00 sec)
mysql>
第二步
查看 /tmp空间
第三步:
修改/etc 下的my.cnf的名字
mv /etc/my.cnf /etc/my_back.cnf
修改 /opt/lampp/etc/my.cnf
中的
tmpdir = /root/mysql_tmp
给指向目录附权限:
cd /root
chmod 777 mysql_tmp/
重启mysql
//opt/lampp/lampp restart
第四步:
查看临时目录是否生效
mysql> show variables like 'tmpdir';
+---------------+----------------------+
| Variable_name | Value |
+---------------+----------------------+
| tmpdir | /opt/lampp/mysql_tmp |
+---------------+----------------------+
1 row in set (0.00 sec)
mysql>