Redhat mysql import data report table is full & logical volume shrinkage and expansion

Recently imported data into mysql consistently reported the error table is full, so experiments were performed to find the cause of this problem, and solve the problem, write it down and record it.

mysql report table isfull

Use mysql to import data to the server and always report table is full. The reason for the online query error is basically that tmp_table_size and tmp_heap_table_size are set too small, but this problem is not what I encountered, because both of mine are set to 1024M , And they all exist under the /home directory. There are several Ts in my /home, so this is not the problem, so I continue to look for the problem. Finally, it should be because data_dir exists in /usr/share. Check it Files, indeed the root directory is full of files, so two changes are made:

  1. Reallocate the capacity of the logical volume, and allocate some capacity of /home to the root directory;
  2. The directory where the datadir stores the number has been changed to /home.

Insert picture description here

Redhat logical volume shrinking and expansion

Logical volume shrink

The shrinking operation can be done according to the following figure:
Insert picture description here

Logical volume expansion

Seeing that the expansion on linuxprobe first needs to cancel the mounting, but because it is the root directory, the cancellation of the mounting has always failed. Later, I checked it on the Internet and it seemed that there was no need to cancel the mounting. You can directly expand the capacity. The operation is as mentioned in this blog post. Yes . But because my file system is not xfs, but ext4, the xfs_growfs /dev/centos/root in the article fails, just execute resize2fs <LV path>, then mount -a, you can view it with df -h You can see that the expansion was successful.

Change the path of mysql datadir and mysql.socket

Just follow the method in this article , but at the same time, you need to pay attention that datadir and socket are not necessarily in the same place. I think the server is not in the same place. If there is no longer a place, you need the method in the above linked article. Make further improvements on the basis of, which means that you also need to copy the data in the original datadir to the newly created folder. The datadir copy method participates in this article. Finally, remember to modify the permissions of the file, turn off selinux, and it will be OK to restart mysql.
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_39805362/article/details/107333695