Home> Topics> Pagoda Panel> body text

What should I do if the disk occupied by the Pagoda Panel database is too large?

藏色散人
Release: 2022-01-27 17:23:21
forward
4642 people have browsed it

This article is provided by the tutorial column ofPagoda Panelto introduce to you how to solve the problem of the Pagoda database taking up too much disk space. I hope it will be helpful to you if you need it!

Today I checked that the server disk was almost full, so I looked for the reason. Two reasons were found;

1. There are many and large mysql-bin.000001 files;

mysql> reset master;

Run the above command to clear the log;

2. The MySQL directory ibdata1 file is too large;

1. Back up the data in the database.

mysqldump -u root -p --extended-insert --all-databases --add-drop-database --disable-keys --flush-privileges --quick --routines --triggers > /home/all-database.sql //有的文档用的是这样的参数: mysqldump -q -uroot -p --add-drop-table --all-databases --events >/home/all-database.sql
Copy after login

If ibdata1 is hundreds of GB, the backup process may take several hours.

2. Stop the MySQL service.

service mysql stop
Copy after login

3. Delete ibdata1, ib_logfile* and other files

mv ibdata1 ibdata1.20160419 mv ib_logfile0 ib_logfile0.20160420 mv ib_logfile1 ib_logfile1.20160420
Copy after login

4. Modify the my.cnf configuration file

vi /etc/mysql/my.cnf
Copy after login

In [mysqld ] Add the following configuration under the subkey:

innodb_file_per_table = 1
Copy after login

6. Restart the MySQL service

service mysql start ps -ef|grep mysql
Copy after login

7. Restore data (re-import data)

mysql -u root -p Enter password: source /home/all-databaes.sql
Copy after login

The above is the detailed content of What should I do if the disk occupied by the Pagoda Panel database is too large?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!