Ubuntu 根目录(/)空间不足处理
近几日某快捷酒店的客户资料数据库被曝光,共有2000万条记录。得到备份文件后我就想导入自己服务器的MySQL数据库来处理。可惜一波三折,小问题有如下几个: 一、5.3G的SQL文件通过FTP上传服务器 phpmyadmin 的 upload 文件夹后通过 phpmyadmin 导入,因为结
近几日某快捷酒店的客户资料数据库被曝光,共有2000万条记录。得到备份文件后我就想导入自己服务器的MySQL数据库来处理。可惜一波三折,小问题有如下几个:
一、5.3G的SQL文件通过FTP上传服务器 phpmyadmin 的 upload 文件夹后通过 phpmyadmin 导入,因为结构问题,失败。
二、采用SSH登陆到 MySQL 命令行,Source命令导入 upload 文件夹中的 5.3GB SQL文件成功,可惜随着SSH窗口关闭,期待中的后台继续插入也停止了。
三、采用 Screen 命令开窗口继续 Source ,后台可以正常导入。但是速度真慢,导了五个多小时才进去30万条记录,这2000万条不就需要20天?坚决不能忍受!!
四、怀疑是数据引擎问题,因为都是 InnobDB,换成MyISAM再次以 Root filesystem)”空间不足,当时安装划分了
/boot 256MB
/tmp 5GB
/home 450GB
/ 11GB
/swap 1024MB
11GB 怎么就不够了呢,多方查找才知道是数据库记录文件作怪,表现形式为:
目录 “/usr/local/mysql/data/” 下存在大量的运行记录文件,文件名为
mysql-bin.000001~~~mysql-bin.002081 等几千个,大小从几十 KB到900MB不等。
原来是数据记录文件,进入Mysql 输入命令
mysql> reset master; (清除日志文件)
进系统一看,原来 / 分区占用97%,现在只用了 51% ,原来这些日志竟然占了5GB左右。惊人!
经查,Mysql Data目录下大量mysql-bin.**** 文件是叫做MySQL Binary Log,
主要有下面两个作用:
- 数据恢复。
- 在主从服务器上提高复制的可靠性。这个其实是主要的作用,但是我根本没有主从服务器,所以用不着,所以修改配置文件,关闭系统日志和同步记录。
命令如下:
找到my.cnf或者my.ini
#log-bin=mysql-bin
#binlog_format=mixed
重启MySQL,彻底解决!
原文地址:Ubuntu 根目录(/)空间不足处理, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



It is a very common problem these days that Ubuntu does not allow its users to open the terminal. If you receive a similar issue and don’t know what to do next, learn about five fixes on how to resolve this “Ubuntu cannot open terminal” issue on your Linux device. Without further ado, let’s dive into what causes it and the solutions available to it. Why can't Ubuntu open the terminal on it? This mainly happens when you install some defective software or modify the terminal configuration. In addition to this, new applications or games that interact with locales and corrupt them can cause similar problems. Some users reported a fix for this issue when searching for Terminal in Ubuntu's activity menu. This shows that

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

1. First, we right-click the blank space of the taskbar and select the [Task Manager] option, or right-click the start logo, and then select the [Task Manager] option. 2. In the opened Task Manager interface, we click the [Services] tab on the far right. 3. In the opened [Service] tab, click the [Open Service] option below. 4. In the [Services] window that opens, right-click the [InternetConnectionSharing(ICS)] service, and then select the [Properties] option. 5. In the properties window that opens, change [Open with] to [Disabled], click [Apply] and then click [OK]. 6. Click the start logo, then click the shutdown button, select [Restart], and complete the computer restart.

OBS is open source software developed by volunteer contributors around the world in their free time. A video live recording software, mainly used for video recording and live streaming. Please note that when installing Ubuntu/Mint, OBSStudio cannot fully work on ChromeOS, and functions such as screen and window capture cannot be used. It is recommended to use xserver-xorg1.18.4 or newer version to avoid potential performance issues with certain features in OBS, such as full-screen projectors. FFmpeg is required. If you don't have FFmpeg installed (if you're not sure, you probably don't), you can get it with: sudoaptinstallffmpeg I already have it installed here

For many users, hacking an Android TV box sounds daunting. However, developer Murray R. Van Luyn faced the challenge of looking for suitable alternatives to the Raspberry Pi during the Broadcom chip shortage. His collaborative efforts with the Armbia

Angular.js is a freely accessible JavaScript platform for creating dynamic applications. It allows you to express various aspects of your application quickly and clearly by extending the syntax of HTML as a template language. Angular.js provides a range of tools to help you write, update and test your code. Additionally, it provides many features such as routing and form management. This guide will discuss how to install Angular on Ubuntu24. First, you need to install Node.js. Node.js is a JavaScript running environment based on the ChromeV8 engine that allows you to run JavaScript code on the server side. To be in Ub

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $
