Mysql slimming Method

Source: Internet
Author: User

Mysql slimming method Note: 1. before performing this operation, stop the Database Service and copy the mqslq5 folder for backup. install the Database Connection Tool navicate on the computer where the database is located; 3. delete useless information. 4. after step 1 is executed, select close connection for your database in navicate. After the execution, start the Database Service and choose to open the connection. in reality, the space that mysql gets smaller is the space that you will release after truncate the tables. Therefore, the actually smaller space depends on the size of your table; www.2cto.com first, remember to stop the mysql software operation steps: 1. First, use the truncate table statement to clear the large data table 2. Back up the database script C: \ Users \ Administrator> mysqldump-umysql-ppassword -- quick -- force -- routines -- add-drop-database Xiesoft -- add-drop-table> d: \ mysqldump_388_2. SQL. After the input, press enter to execute the statement. You need to perform the operation on the computer where the database is located: you can copy the commands in my documents and right-click and paste them in the dos box. This process takes several minutes, if the number of devices in the database and the video table are extremely large, it may take 10 minutes. Please wait! Www.2cto.com 3. stop mysql service; 4. modify my. added after the INI file: innodb_file_per_table. Pay attention to my. ini 5. Delete the ibdate file and log file 6. Start the mysql service. 8. Import the data file C: \ Users \ Administrator> mysql-umysql-ppassword anxiesoft <d: \ mysqldump_388_2. SQL has the same operation method as 2. Copy the command, paste it, and press Enter. This process is relatively slow. The database I backed up is 370 MB, and the import time is less than 5 minutes; please wait patiently at the site according to your actual situation! 9. Check whether the weight loss is successful: 1) check whether the idbata1 In the mysql directory is smaller. Or whether the entire mysql5 folder is small; 2) perform data operations on the platform and check whether the folder is running normally. If a table becomes very large later, you can clear the table and run: truncate table tb_name; then run: OPTIMIZE table tb_name to recycle space.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.