17

I get this error when trying to start MySQL: The partition with /var/lib/mysql is too full!

Here is the output of df -h:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       455G   77G  356G  18% /
none            4,0K     0  4,0K   0% /sys/fs/cgroup
udev            1,9G  4,0K  1,9G   1% /dev
tmpfs           387M  1,3M  386M   1% /run
none            5,0M     0  5,0M   0% /run/lock
none            1,9G  1,2M  1,9G   1% /run/shm
none            100M   28K  100M   1% /run/user

This shows that the partition is nowhere near full.

Parto
  • 15,325
  • 24
  • 86
  • 117
rocketgear
  • 409
  • 1
  • 3
  • 7

9 Answers9

13

I finally fixed it by running sudo /etc/init.d/mysql start. I just had to insert sudo in front of the command.

rocketgear
  • 409
  • 1
  • 3
  • 7
6

try this:

sudo service mysql stop
sudo service mysql start
Parto
  • 15,325
  • 24
  • 86
  • 117
3

In my case the error resulted of changing the ip address on the server.

cat /var/log/mysql/error.log

150427 23:01:08 InnoDB: 5.5.43 started; log sequence number 11731761
150427 23:01:08 [Note] Server hostname (bind-address): '192.168.1.234'; port: 3306
150427 23:01:08 [Note]   - '192.168.1.234' resolves to '192.168.1.234';
150427 23:01:08 [Note] Server socket created on IP: '192.168.1.234'.
150427 23:01:08 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
150427 23:01:08 [ERROR] Do you already have another mysqld server running on port: 3306 ?
150427 23:01:08 [ERROR] Aborting

changing the

 bind-address       

in

 /etc/mysql/my.cnf

to the current ip and restarting the server

sudo /etc/init.d/mysql start

solved the problem

user1007017
  • 131
  • 2
2

There are two possible problems with Mysql package:

  1. Really a space problem:

    Many distributions have their /var directory in the original root partition which is not made big enough by default to hold real-life data. They usually create separate partition for /usr with tons of space

    Check this and you will get full details and your answer

    https://serverfault.com/questions/256729/error-the-partition-with-var-lib-mysql-is-too-full

  2. It is a bug which might not have been fixed and to fix it follow this article:

    https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/118523

Chinmaya B
  • 6,122
  • 7
  • 24
  • 43
1

I have faced same issue, in my case there is another mysql service was running

$ ps -aux | grep mysql
mysql     7241  0.0  5.1 562600 52812 ?        Ssl  13:36   0:02 /usr/sbin/mysql
ubuntu   13580  0.0  0.0  10468   916 pts/0    S+   15:50   0:00 grep --color=au

$ sudo kill  7241

Then I started mysql.

$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld                                 [ OK ]
rab
  • 111
0

In my case the problem was that /var was full:

$ df -h  # More info with du -h /var | sort -hr | head -10
...
/dev/sda3       2.7G  2.7G     0 100% /var

So I just used ncdu (another nice tool is dust) to check what was taking so much space:

sudo ncdu /var

Delete some useless stuff with d, restarted

sudo systemctl restart mysql.service

And voilà, everything working now.

What to delete? Each case should be analyzed carefully. Start with sudo apt autoremove, snap stuff, rotate your logs and maybe remove old stuff/backups: /var/crash, /var/cache, /var/tmp

Pablo Bianchi
  • 15,657
0

In my case, it was just the date was wrong. Somehow, after a blade failure (it is a VM), the OS started up with a wring date. Once i changed to the corrent date, mysql started correctly

0

In the partition /var there are several directories that accumulate many files which can fill up the partition.

In my case logs are saved in /var/logs filling up /var prevented me from starting mysql.

I deleted some of those old logs and that solved my problem. If you do not have log rotation it is better that you try acerlo since if you do not have this process the logs can add up to many GB in a single file.

Zanna
  • 70,465
Alain
  • 1
-1

Run the command sudo apt-get --reinstall install mysql-server to re-install MySQL. It will re-create the missing directories and allow you to start the server again.

Bert
  • 3,225
  • 1
  • 14
  • 12
  • This is what I got: dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.5; however: Package mysql-server-5.5 is not configured yet. How do I use --configure? – rocketgear Jun 13 '14 at 19:51