How-To move the mysql tmpdir out /tmp and into /home

Rate this post

If the cPanel server is using MariaDB as the MySQL server then the following should be done first.

Create file /etc/systemd/system/mariadb.service.d/override.conf and add the following contents.

[Service]
ProtectHome=false

Then run the following

systemctl daemon-reload
/scripts/restartsrv_mysql

If you are using MySQL RPMs and not MariaDB then start here. If you’re using MariaDB then continue with the following changes after disabling ProtectHome.

These are the steps needed to move the MySQL server tmpdir to /home:

mkdir /home/mysqltmp
chown mysql:mysql /home/mysqltmp

Then put the following in /etc/my.cnf under [mysqld]

tmpdir=/home/mysqltmp

and restart MySQL.


/scripts/restartsrv_mysql


When you run

mysqladmin variables|grep tmpdir


you should see this

vps root # mysqladmin variables|grep tmpdir
| slave_load_tmpdir                      | /home/mysqltmp                                                                            |
| tmpdir                                  | /home/mysqltmp                                                                            |
vps root #
Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

A2 Hosting, a popular web hosting provider, recently experienced a period of downtime.

Next Post

How-to clean your /tmp when mysql tmp is full

Related Posts
Total
0
Share