Home > Database > Mysql Tutorial > MYSQL用批处理命令自动删除重建数据库实现压缩ibdata1文件容量_MySQL

MYSQL用批处理命令自动删除重建数据库实现压缩ibdata1文件容量_MySQL

WBOY
Release: 2016-06-01 13:19:02
Original
880 people have browsed it

bitsCN.com

MYSQL用批处理命令自动删除重建数据库实现压缩ibdata1文件容量

一、友情提醒,以下操作会删除数据库,请事先自行备份数据库文件

欢迎转载:http://blog.csdn.net/aminfo/article/details/19507491

二、需要3个文件,以下为3个文件的文件名及内容:

文件1:Mysql_Drop_DataBase.txt,内容如下:

drop database yourdatabase; 
Copy after login

文件2:Mysql_Create_DataBase.txt,内容如下:

create database yourdatabase;
Copy after login

文件3:自动压缩ibdata1文件容量.bat,内容如下:

rem 删除数据库mysql -u 用户名 --password=密码 < "Mysql_Drop_DataBase.txt"rem 停止mysql服务net stop mysqlrem 删除ibdata1、iblogfile0、ib_logfile1文件,请自行替换以下文件路径Del "G:/MySQL Datafiles/ibdata1"Del "C:/ProgramData/MySQL/MySQL Server 5.5/data/ib_logfile0"Del "C:/ProgramData/MySQL/MySQL Server 5.5/data/ib_logfile1"rem 启动mysql服务net start mysqlrem 创建数据库mysql -u 用户名 --password=用户名 < "Mysql_Create_DataBase.txt"
Copy after login
三、点击“自动压缩ibdata1文件容量.bat”开始运行  bitsCN.com
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template