Preface Recently, I added two fields to a table in the database. Later, it prompted something like insufficient disk space. Then the database was disconnected, and I couldn't connect to it after that. Later, after thinking about it, I finally solved the problem. This experience was really terrifying. This article records the solution to the problem of mysql being unable to start due to insufficient disk space. Here’s how Operating system: Ubuntu. Insufficient disk space causes MySQL to fail to start, which can cause the following problems: root@iZ28z558vv0Z:/etc/mysql# mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) root@iZ28z558vv0Z:/b# service mysql start start: Job failed to start root@iZ28z558vv0Z:/var/lib# service mysqld start mysqld: unrecognized service Solution: Find the mysql configuration file my.cnf: root@iZ28z558vv0Z:/etc/mysql# ls conf.d debian.cnf debian-start my.cnf root@iZ28z558vv0Z:/etc/mysql# vi my.cnf The datadir item in the file shows /var/lib/mysql [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking Because the disk space is insufficient, we need to check the location where MySQL saves data, the usage of the disk space of datadir or tmpdir, and check the usage of the disk space of datadir: root@iZ28z558vv0Z:/var# df /var Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 41151808 39038392 0 100% / It can be seen from the above that the disk space availability is obviously 0, which is why mysql cannot be started. The problem can be solved by deleting other files in the /var directory to free up disk space, and then restarting the mysql service. Summarize The above is the full content of this article. I hope that the content of this article can be of some help to your study or work. If you have any questions, you can leave a message to communicate. You may also be interested in:
|
<<: JS implements click drop effect
>>: How to isolate users in docker containers
Gird layout has some similarities with Flex layou...
This article example shares the specific code for...
1. Install Apache $ sudo apt update && su...
1. Overview 1.1 Basic concepts: Docker is an open...
1. First, you need to use the target selector of ...
Preface The SQL mode affects the SQL syntax that ...
First, let's simulate the data coming from th...
Target Display one of the data in the iostat comm...
Table of contents 1. lazy 2.trim 3.number 4.stop ...
Table of contents What are spread and rest operat...
Generally, learning Java and deploying projects a...
Scenario simulation: The operation and maintenanc...
Problem Description MySQL is started successfully...
This article shares the specific code of JavaScri...
Beginners can learn HTML by understanding some HT...