Home Database Mysql Tutorial MySQL数据库清理MyISAM Innodb表(支持MySQL5.1.6以上的版本)_MySQL

MySQL数据库清理MyISAM Innodb表(支持MySQL5.1.6以上的版本)_MySQL

Jun 01, 2016 pm 01:43 PM
clean up surface

bitsCN.com 数据中心有大量的MyISAM log表需要定时清理,定为每周末,10G左右,5-10分钟完成.
event 调用这里就不写了,直接上存储过程....
[sql] view plaincopyprint?
DROP PROCEDURE IF EXISTS proc_optable; 
tudou@gyyx 
2012-02-22 
CREATE PROCEDURE proc_optable() 
BEGIN 
DECLARE dono INT DEFAULT 0; 
DECLARE o VARCHAR(2000); 
DECLARE optable CURSOR  
FOR  
SELECT CONCAT('OPTIMIZE TABLE `',TABLE_SCHEMA,'`.`',TABLE_NAME,'`;') from information_schema.`TABLES` WHERE TABLE_TYPE='BASE TABLE' AND ENGINE IN ('MyISAM','InnoDB','BDB'); 
DECLARE CONTINUE HANDLER FOR NOT FOUND SET dono=1; 
SET dono=0; 
OPEN optable; 
REPEAT 
FETCH optable INTO o; 
set @o=o; 
PREPARE MSQL FROM @o; 
EXECUTE MSQL; 
UNTIL dono END REPEAT; 
 
CLOSE optable; 
END   


摘自 ylqmf的专栏 bitsCN.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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Where to check win11 disk cleanup Where to check win11 disk cleanup Jun 29, 2023 pm 09:25 PM

Where can I check disk cleanup in win11? As the system is used for a long time, there will often be more than ten gigabytes or more useless junk files in the c drive or other computer disks. At this time, using the disk cleanup function that comes with win11 can help us quickly clean up these useless files. However, many users do not know where the disk cleanup function of win11 is and how to operate it. Today, the editor will bring you the steps to check the junk cleaning function that comes with Win 11, and let me explain it to you. Steps to check win11’s built-in junk cleaning function 1. First, press the [Win] key on the keyboard, or click [Start Menu] on the taskbar, and then select [Settings] under pinned applications; 2. The current path is: System >storage,

How to effectively clean junk and cache in win7 system How to effectively clean junk and cache in win7 system Dec 27, 2023 pm 07:53 PM

When we use Win7 computers on a daily basis, a bunch of system cache garbage often accumulates over time, which requires us to clean it manually. So how to clean the garbage and cache of each system disk? Let’s take a look. How to clean up junk and cache in Windows 7 1. Find the disk you want to clean, right-click and select Properties. 2. The computer will pop up the detailed properties of the hard disk. Here we continue to click "Disk Cleanup" 3. After clicking, we select the option you want to clean here and click Clean.

Are administrator rights required: win10 required to clean C drive Are administrator rights required: win10 required to clean C drive Jan 12, 2024 pm 03:45 PM

Many users have recently encountered the problem that when cleaning files in the C drive, a pop-up window will appear, indicating that permissions need to be granted to delete them. Click to grant permissions, but they still cannot be deleted. We only need to make a slight modification in the group policy. It can be solved. Does cleaning up the C drive in Win10 require administrator rights? Answer: Cleaning up the C drive in Win10 requires administrator rights. 1. Enter the command using the win+r shortcut key in the pop-up window, and press the Enter key. 2. Click to open----. 3. Then, on this page, change it to. 4. Similarly, set the options. 5. Finally, save the settings, close all pages, restart the computer, and then clean the C drive directly.

Nginx cache cleaning configuration to keep website content updated Nginx cache cleaning configuration to keep website content updated Jul 05, 2023 pm 10:28 PM

Nginx cache cleaning configuration to keep website content updated When building a website, we often use Nginx as a reverse proxy server to speed up website access and cache static files. However, when we update website content, we need to clear Nginx's cache in time to keep users accessing the latest content. This article will introduce how to configure Nginx cache cleaning to keep website content updated. 1. Configure the cache path. First, we need to configure the cache path of Nginx. Open Nginx configuration

How to clear cache data of QQ Browser How to clear cache data of QQ Browser Jan 29, 2024 pm 06:03 PM

How to clear QQ browser cache data? QQ Browser is a search software with a large number of users. Its excellent speed and rich functions make many users use this software regularly. We all know that after using software for a long time, it will leave a lot of cache files and other junk information. If not cleaned up in time, it will slow down the browser's response speed. At this time, we need to clean it regularly and in time. After clearing the cache, it will be more convenient to use and the response speed will be better. Let’s take a look at how to clear the cache when using QQ Browser! QQ Browser cache data cleaning method and steps are introduced. Step 1: Open QQ Browser and click the "Menu" bar in the upper right corner of the main page. Step 2: In the drop-down menu bar option, click Play

Introduction to the tutorial of cleaning and deleting hiberfil files in win10 Introduction to the tutorial of cleaning and deleting hiberfil files in win10 Mar 28, 2024 pm 03:16 PM

Many win10 users can see the hiberfil.sys file in the C drive, and this file often occupies a large amount of the system's C drive. Therefore, many users who do not have enough C drive want to delete this file. Please see the introduction below for details. . 1. View the hibernation file and remove the check mark in front of the following mark in the pop-up window. 2. Check the c drive again and find several large files, among which hiberfil.sys is the hibernation file. Open the cmd command window here. Some computers may not have administrator rights. You can find the cmd command directly in the system directory and right-click to execute it as an administrator. 3. Entering powercfg-hoff in the command window will automatically turn off the hibernation function, and the hibernation file will also automatically

Linux server log is too large, how to solve it? Linux server log is too large, how to solve it? Jun 29, 2023 pm 11:09 PM

Common problems of too-large log files on Linux servers and their solutions. With the rapid development of the Internet and the widespread use of servers, it has become a common problem that server log files are getting larger and larger. A large amount of log data not only takes up disk space, but may also affect the performance and operational stability of the server. This article will discuss the common problem of too large log files on Linux servers and provide some solutions. 1. Common log files on Linux servers. Common log files include system logs, application logs, We

How to clean up win11 hibernation files How to clean up win11 hibernation files Jun 29, 2023 am 11:35 AM

How to clean win11 hibernation files? When many friends clean up the disk of their win11 computer, they find that new junk files are generated every time they are restarted. This is the computer's hibernation file. These hibernation files are automatically generated by the system. After we clean up these hibernation files, we can reduce a very large burden on the disk. However, many friends do not know how to clean up hibernation files. Below, the editor will bring you win11 hibernation. File cleaning tutorial. Win11 hibernation file cleaning tutorial 1. Find the CMD program on the C drive. The path is as follows: C: WindowsSystem32 and then right-click: Run as administrator. 2. Enter the command: powercfg-hoff and press Enter. You will see the following:

See all articles