1

my rented server is currently saying that mysql is too full when trying to start it when using /etc/init.d/mysql start. However using sudo /etc/init.d/mysql start it works normally.

Running df -h shows that there are no full partitions

Filesystem      Size  Used Avail Use% Mounted on
rootfs           20G  1.5G   17G   9% /
/dev/root        20G  1.5G   17G   9% /
devtmpfs         32G  4.0K   32G   1% /dev
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            6.3G  752K  6.3G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             32G     0   32G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/md2        127G   11G  111G   9% /home

as requested df -i

Filesystem      Inodes  IUsed   IFree IUse% Mounted on
rootfs         1281120  45568 1235552    4% /
/dev/root      1281120  45568 1235552    4% /
devtmpfs       8242291   1516 8240775    1% /dev
none           8250649      2 8250647    1% /sys/fs/cgroup
none           8250649   1031 8249618    1% /run
none           8250649      1 8250648    1% /run/lock
none           8250649      1 8250648    1% /run/shm
none           8250649      2 8250647    1% /run/user
/dev/md2       8462336 990512 7471824   12% /home

I am confused because mysql claims its full when restarting normally, but then lets me restart it when using sudo, and df -h shows that there is plenty of space.

Thank you for the help.

  • Could you add a df -i ? – Dom Sep 17 '14 at 6:51
  • @Dom added df -i – jjacobson Sep 17 '14 at 6:53
  • What do you mean "restarting normally, but then lets me restart it when using sudo"? Exactly what is "restarting normally"? – garethTheRed Sep 17 '14 at 7:01
  • Can you provide exact error with the restart command which you are using to restart? – Pratap Sep 17 '14 at 7:04
  • @garethTheRed When not using sudo it fails to start and I get /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full! – jjacobson Sep 17 '14 at 7:18
0

Always control services as root.

While you can log in as root to control a service, it isn't recommended.

Instead, use either:

sudo /etc/init.d/mysql restart

Or:

su -c "/etc/init.d/mysql restart"

The former requires the logged in user to be configured within sudo. This involves being a member of a certain group - the group depends on the distro. The advantage is that the user will be using their own password.

The latter will involve the logged in user having the root password to run the command.

| improve this answer | |
  • Thanks for the help man! Seems a bit weird that it complains about space during a permissions problem, but hey what can you do. – jjacobson Sep 17 '14 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.