mysql如果保留日志的话,时间长了,会产生很多日志,很占空间,可以用以下方法删除: show master logs; reset master; show master logs; 就ok了。 ========================================= mysql> show master logs;
+------------------+------------+
| Log_name | File_size |
+------------------+------------+
| mysql-bin.000016 | 1073741951 |
| mysql-bin.000017 | 1073742130 |
| mysql-bin.000001 | 1073742026 |
| mysql-bin.000002 | 1073741908 |
| mysql-bin.000003 | 1073741956 |
| mysql-bin.000004 | 1073741892 |
| mysql-bin.000005 | 1073742084 |
| mysql-bin.000006 | 1073741920 |
| mysql-bin.000007 | 1073741908 |
| mysql-bin.000008 | 1073741919 |
| mysql-bin.000009 | 1073741875 |
| mysql-bin.000010 | 1073741966 |
| mysql-bin.000011 | 1073742094 |
| mysql-bin.000012 | 1073742138 |
| mysql-bin.000013 | 1073741956 |
| mysql-bin.000014 | 1073741973 |
| mysql-bin.000015 | 1073741871 |
| mysql-bin.000016 | 1073741951 |
| mysql-bin.000017 | 1073742130 |
| mysql-bin.000018 | 1073742005 |
| mysql-bin.000019 | 1073741872 |
| mysql-bin.000020 | 1073741908 |
| mysql-bin.000021 | 1073742138 |
| mysql-bin.000022 | 1073741875 |
| mysql-bin.000023 | 1073742066 |
| mysql-bin.000024 | 1073742132 |
| mysql-bin.000025 | 749955561 |
| mysql-bin.000026 | 170706411 |
| mysql-bin.000027 | 106 |
| mysql-bin.000028 | 106 |
| mysql-bin.000029 | 106 |
| mysql-bin.000030 | 1073742146 |
| mysql-bin.000031 | 1073741939 |
| mysql-bin.000032 | 1073741974 |
| mysql-bin.000033 | 1073741977 |
| mysql-bin.000034 | 1073742031 |
| mysql-bin.000035 | 1073742000 |
| mysql-bin.000036 | 1073741972 |
| mysql-bin.000037 | 1073741945 |
| mysql-bin.000038 | 1073742138 |
| mysql-bin.000039 | 678050023 |
| mysql-bin.000040 | 0 |
| mysql-bin.000041 | 0 |
| mysql-bin.000042 | 0 |
| mysql-bin.000043 | 0 |
| mysql-bin.000044 | 0 |
| mysql-bin.000045 | 0 |
| mysql-bin.000046 | 0 |
| mysql-bin.000047 | 0 |
| mysql-bin.000048 | 0 |
| mysql-bin.000049 | 0 |
| mysql-bin.000050 | 0 |
| mysql-bin.000051 | 0 |
| mysql-bin.000052 | 0 |
| mysql-bin.000053 | 0 |
| mysql-bin.000054 | 0 |
| mysql-bin.000055 | 0 |
| mysql-bin.000056 | 0 |
| mysql-bin.000057 | 0 |
| mysql-bin.000058 | 0 |
| mysql-bin.000059 | 0 |
| mysql-bin.000060 | 0 |
| mysql-bin.000061 | 0 |
| mysql-bin.000062 | 0 |
| mysql-bin.000063 | 0 |
| mysql-bin.000064 | 0 |
| mysql-bin.000065 | 0 |
| mysql-bin.000066 | 0 |
| mysql-bin.000067 | 0 |
| mysql-bin.000068 | 0 |
| mysql-bin.000069 | 0 |
| mysql-bin.000070 | 0 |
| mysql-bin.000071 | 0 |
| mysql-bin.000072 | 0 |
| mysql-bin.000073 | 0 |
| mysql-bin.000074 | 0 |
| mysql-bin.000075 | 0 |
| mysql-bin.000076 | 0 |
| mysql-bin.000077 | 0 |
| mysql-bin.000078 | 0 |
| mysql-bin.000079 | 0 |
| mysql-bin.000080 | 0 |
| mysql-bin.000081 | 0 |
| mysql-bin.000082 | 0 |
| mysql-bin.000083 | 0 |
| mysql-bin.000084 | 0 |
| mysql-bin.000085 | 0 |
| mysql-bin.000086 | 0 |
| mysql-bin.000087 | 0 |
| mysql-bin.000088 | 0 |
| mysql-bin.000089 | 0 |
| mysql-bin.000090 | 0 |
| mysql-bin.000091 | 0 |
| mysql-bin.000092 | 0 |
| mysql-bin.000093 | 0 |
| mysql-bin.000094 | 0 |
| mysql-bin.000095 | 0 |
| mysql-bin.000096 | 0 |
| mysql-bin.000097 | 0 |
| mysql-bin.000098 | 0 |
| mysql-bin.000099 | 0 |
| mysql-bin.000100 | 0 |
| mysql-bin.000101 | 0 |
| mysql-bin.000102 | 0 |
| mysql-bin.000103 | 0 |
| mysql-bin.000104 | 0 |
| mysql-bin.000105 | 0 |
| mysql-bin.000106 | 0 |
| mysql-bin.000107 | 0 |
| mysql-bin.000108 | 0 |
| mysql-bin.000109 | 0 |
| mysql-bin.000110 | 0 |
| mysql-bin.000111 | 0 |
| mysql-bin.000112 | 0 |
| mysql-bin.000113 | 0 |
| mysql-bin.000114 | 0 |
| mysql-bin.000115 | 0 |
| mysql-bin.000116 | 0 |
| mysql-bin.000117 | 0 |
| mysql-bin.000118 | 0 |
| mysql-bin.000119 | 0 |
| mysql-bin.000120 | 0 |
| mysql-bin.000121 | 0 |
| mysql-bin.000122 | 0 |
| mysql-bin.000123 | 0 |
| mysql-bin.000124 | 0 |
| mysql-bin.000125 | 0 |
| mysql-bin.000126 | 0 |
| mysql-bin.000127 | 0 |
| mysql-bin.000128 | 0 |
| mysql-bin.000129 | 0 |
| mysql-bin.000130 | 0 |
| mysql-bin.000131 | 0 |
| mysql-bin.000132 | 0 |
| mysql-bin.000133 | 0 |
| mysql-bin.000134 | 0 |
| mysql-bin.000135 | 0 |
| mysql-bin.000136 | 0 |
| mysql-bin.000137 | 0 |
| mysql-bin.000138 | 0 |
| mysql-bin.000139 | 0 |
| mysql-bin.000140 | 0 |
| mysql-bin.000141 | 0 |
| mysql-bin.000142 | 0 |
| mysql-bin.000143 | 0 |
| mysql-bin.000144 | 0 |
| mysql-bin.000145 | 0 |
| mysql-bin.000146 | 0 |
| mysql-bin.000147 | 0 |
| mysql-bin.000148 | 0 |
| mysql-bin.000149 | 0 |
| mysql-bin.000150 | 0 |
| mysql-bin.000151 | 0 |
| mysql-bin.000152 | 0 |
| mysql-bin.000153 | 0 |
| mysql-bin.000001 | 1073742026 |
| mysql-bin.000002 | 1073741908 |
| mysql-bin.000003 | 1073741956 |
| mysql-bin.000004 | 1073741892 |
| mysql-bin.000005 | 1073742084 |
| mysql-bin.000006 | 1073741920 |
| mysql-bin.000007 | 1073741908 |
| mysql-bin.000008 | 1073741919 |
| mysql-bin.000009 | 1073741875 |
| mysql-bin.000010 | 1073741966 |
| mysql-bin.000011 | 1073742094 |
| mysql-bin.000012 | 1073742138 |
| mysql-bin.000013 | 1073741956 |
| mysql-bin.000014 | 1073741973 |
| mysql-bin.000015 | 1073741871 |
| mysql-bin.000016 | 1073741951 |
| mysql-bin.000017 | 1073742130 |
| mysql-bin.000018 | 1073742005 |
| mysql-bin.000019 | 1073741872 |
| mysql-bin.000020 | 1073741908 |
| mysql-bin.000021 | 1073742138 |
| mysql-bin.000022 | 1073741875 |
| mysql-bin.000023 | 1073742066 |
| mysql-bin.000024 | 1073742132 |
| mysql-bin.000025 | 749955561 |
| mysql-bin.000026 | 170706411 |
| mysql-bin.000027 | 106 |
| mysql-bin.000028 | 106 |
| mysql-bin.000029 | 106 |
| mysql-bin.000030 | 1073742146 |
| mysql-bin.000031 | 1073741939 |
| mysql-bin.000032 | 1073741974 |
| mysql-bin.000033 | 1073741977 |
| mysql-bin.000034 | 1073742031 |
| mysql-bin.000035 | 1073742000 |
| mysql-bin.000036 | 1073741972 |
| mysql-bin.000037 | 1073741945 |
| mysql-bin.000038 | 1073742138 |
| mysql-bin.000039 | 678050023 |
+------------------+------------+
194 rows in set (0.02 sec)
mysql> reset master;
Query OK, 0 rows affected, 155 warnings (24.84 sec)
mysql> show master logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 737352 |
+------------------+-----------+
1 row in set (0.00 sec)
|
分享到:
相关推荐
### MySQL日志分析详解 #### 一、引言 MySQL作为一种广泛使用的开源关系型数据库管理系统,在维护数据库稳定性与性能方面发挥着至关重要的作用。为了更好地监控数据库的状态并及时解决潜在问题,MySQL提供了多种...
本文将详细介绍四种清理MySQL日志的方法,并提供具体的实施步骤和注意事项。 #### 方法一:使用 PURGE MASTER LOGS 命令 **语法**: ```sql PURGE {BINARY | MASTER} LOGS {TO 'log_name' | BEFORE datetime_expr}...
MySQL日志主要分为四类:错误日志、查询日志、二进制日志和慢查询日志。错误日志记录MySQL服务的启动、运行或停止MySQL服务时出现的问题。查询日志记录建立的客户端连接和执行的语句。二进制日志记录所有更改数据的...
MySQL提供`PURGE BINARY LOGS`命令用于删除旧的二进制日志。 7. 性能优化 - 日志大小限制:适当调整日志文件大小,避免日志文件过大导致磁盘空间耗尽。 - 日志格式:选择合适的日志格式,如ROW、STATEMENT或MIXED...
### MySQL根据日志恢复数据详细步骤 #### 一、引言 MySQL作为一款广泛使用的开源关系型数据库管理系统,因其高效稳定、易于维护等特性而深受开发者喜爱。然而,在实际使用过程中,难免会遇到误删数据的情况,这时就...
该脚本还具备删除历史备份记录的功能,可以配置删除多少次以前的备份文件,同时还可以配置,在备份发生错误时,不删除以前的备份记录。 自动备份MySQl数据库的使用法法: 请先用记事本打开 MysqlAutoBackup.bat ...
2. 数据恢复:支持从 MySQL 日志文件中恢复已删除或已更改的数据,帮助用户恢复数据库的正常状态。 3. 日志分析:支持对 MySQL 日志文件进行分析和统计,帮助用户了解数据库的使用情况和性能瓶颈。 4. 自动化处理:...
"Windows下MySql自动备份脚本(有备份日志,且可以删除历史备份)"的资源提供了一个解决方案,它是一个批处理脚本(MysqlAutoBackup.bat),能够自动化执行MySQL的备份过程,同时生成备份日志并清理历史备份。...
MySQL bin-log 日志清理方式 MySQL bin-log 日志是一种重要的数据库日志机制,它可以记录数据库的所有操作,以便在出现问题时进行数据恢复和主从服务器之间的同步数据。然而,随着时间的推移,bin-log 文件会不断...
在MySQL培训日志中,我们将深入探讨SQL的基本概念、常用命令以及各种查询技术。 1. SQL概述: SQL,全称Structured Query Language(结构化查询语言),是用于管理和操作数据库的标准语言。它包括数据查询、数据...
本文将详细介绍如何正确地删除MySQL日志,以及在删除过程中需要注意的事项。 首先,MySQL的日志主要包括二进制日志(Binary Logs)和错误日志(Error Logs)。二进制日志记录了所有改变数据库的数据更改操作,这...
### MySQL正确清理Binlog日志的两种方法 #### 前言 在MySQL数据库中,Binlog(二进制日志)记录了所有更改数据库表结构或者数据的操作,这对于实现基于时间点的数据恢复、主从复制等场景至关重要。然而,随着...
MySQL日志清理手册 在MySQL数据库管理中,日志文件起着至关重要的作用,它们记录了数据库的各种操作,包括但不限于错误信息、查询历史以及数据变更等。这些日志对于故障排查、数据恢复和主从复制至关重要。然而,...
MySQL的二进制日志(binlog)是数据库系统中至关重要的组件,它记录了所有对MySQL数据库进行的改变操作,包括表结构的修改(如CREATE、ALTER TABLE等)和表数据的更新(INSERT、UPDATE、DELETE等)。binlog不记录...
MySQL日志是数据库管理系统中至关重要的一部分,它记录了数据库的各种操作,包括查询、更新、插入和删除等。日志的存在确保了数据的安全性、可恢复性和性能优化。在本章中,我们将深入探讨MySQL的日志系统,主要包括...
MySQL数据库的binlog日志是数据安全的重要保障,它记录了所有的DDL(Data Definition Language,如CREATE、ALTER、DROP等)和DML(Data Manipulation Language,如INSERT、UPDATE、DELETE等)语句,但不包括SELECT...
MySQL 日志备份与恢复 MySQL 是一种常用的关系数据库管理系统,它提供了多种日志机制来记录数据库的各种操作和错误信息。这些日志文件对于数据库的备份和恢复至关重要。本文将详细介绍 MySQL 的日志机制、备份类型...
#### 一、MySQL日志文件类型 MySQL提供了多种日志文件来帮助DBA监控系统运行状态以及进行故障排除,具体包括以下几种: 1. **错误日志(Error Log)**:记录MySQL服务器启动、运行或关闭过程中发生的任何问题,是...
MySQL日志与备份还原是数据库管理中的重要环节,它们对于数据的安全性和可恢复性起着至关重要的作用。本文主要探讨了MySQL的错误日志、二进制日志(BINLOG)、数据备份和数据恢复这四个关键知识点。 首先,错误日志...