虚拟机内存满之后怎么删除相应的垃圾数据 您所在的位置:网站首页 虚拟机日志文件怎么删除 虚拟机内存满之后怎么删除相应的垃圾数据

虚拟机内存满之后怎么删除相应的垃圾数据

2024-07-09 02:03| 来源: 网络整理| 查看: 265

今天遇到一个问题 在虚拟机上昨天都是好好的系统 今天数据库出现异常 报错信息如下

打开这个localhost日志文件

在网上看了下我的这个错误信息 发现说我的空间满了

用df -h 命令查看虚拟机的容量信息

嗯。。确实硬盘满了  

如何删除虚拟机上垃圾文件呢

首先用du -sh * 查看各个文件的大小

最终我查看是我的mysql中占文件很多 最后找的大的原因是mysql日志的文件都非常的大

这些日志信息都是用来做主从复制的 如果没用到主从 这些日志文件我们可以直接删掉  当然不能用rm 来进行删除 不然会出现问题

按下面方式进行删除

mysql -u root -p Enter password:

Welcome to the MySQL monitor.Commands end with ; or g.Your MySQL connection id is 2819416Server version: 5.5.24-0ubuntu0.12.04.1-log (Ubuntu)Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> reset master;Query OK, 0 rows affected (3 min 37.65 sec)其实关键的命令就是reset master;

这个命令会清空mysql-bin文件。  

 

 

 

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有