1

I am exactly with the problem of the following question on my server and when accessing the log file it appears empty, i.e., no information.

MySQL Job failed to start

Data from my server:

ricardoramos@garapa:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise

I have only ssh access to my server. In addition, I have already performed all the steps suggested by @Rajesh, however when reinstalling mysql-server with the command:

sudo apt-get install mysql-server-5.5

I get the following message:

ERROR: There's not enough space in /var/lib/mysql/

E: Write error - write (28: There is no space available on the device)

ricardoramos@garapa:~$ sudo fdisk -l

Disco /dev/sda: 1000.2 GB, 1000202305536 bytes
255 cabeças, 63 setores/trilhas, 121601 cilindros, total de 1953520128 setores
Unidades = setores de 1 * 512 = 512 bytes
Tamanho do setor (lógico/físico): 512 bytes / 512 bytes
Tamanho da E/S (mínimo/ideal): 512 bytes / 512 bytes
Identificador do disco: 0x471b256c

Dispositivo Boot Início Fim Blocos Id Sistema
/dev/sda1   *         128  1603201151   801600512   83  Linux
/dev/sda2      1603201152  1953517951   175158400    5  Estendida
/dev/sda5      1603201280  1945706751   171252736   83  Linux
/dev/sda6      1945706880  1953517951     3905536   82  Linux swap / Solaris


ricardoramos@garapa:~$ df -h
Sist. Arq.      Tam. Usado Disp. Uso% Montado em
/dev/sda5       163G  155G     0 100% /
udev            1,5G  4,0K  1,5G   1% /dev
tmpfs           599M  724K  599M   1% /run
none            5,0M     0  5,0M   0% /run/lock
none            1,5G     0  1,5G   0% /run/shm
overflow        1,0M  1,0M     0 100% /tmp
/dev/sda1       759G  4,1G  717G   1% /home

ricardoramos@garapa:~$ dpkg -l | grep mysql
iU  libdbd-mysql-perl                      4.020-1ubuntu0.1                           Perl5 database interface to the MySQL database
ii  libmysql-java                          5.1.16-2                                   Java database (JDBC) driver for MySQL
iU  libmysqlclient18                       5.5.54-0ubuntu0.12.04.1                    MySQL database client library
iU  mysql-client-5.5                       5.5.54-0ubuntu0.12.04.1                    MySQL database client binaries
ii  mysql-client-core-5.5                  5.5.34-0ubuntu0.12.04.1                    MySQL database core client binaries
ii  mysql-common                           5.5.54-0ubuntu0.12.04.1                    MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-gui-tools-common                 5.0r14+openSUSE-2.2ubuntu2                 Architecture independent files for MySQL GUI Tools
iU  mysql-server                           5.5.54-0ubuntu0.12.04.1                    MySQL database server (metapackage depending on the latest version)
ii  mysql-server-core-5.5                  5.5.54-0ubuntu0.12.04.1                    MySQL database server binaries

Also, I already checked the following question in askubuntu, but I still have no solution.

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

How should I do to get the MySQL server installed?

ricardoramos
  • 891
  • 3
  • 18
  • 35

2 Answers2

1

Change the data directory path for mysql as your root directory 100% used. You have space(717G) in your /home directory

To change the Path follow the steps : How to change MySQL data directory

  • Hello @Jaiprakash, you say what directory of mysql? Could you please detail it? It is just which directory I should move that I am in doubt. – ricardoramos Mar 15 '18 at 05:15
  • 1
    move /var/lib/mysql/ to /home/new-directory-name and chown new-directory-name to mysql user and group. – Jaiprakash Khowal Mar 15 '18 at 05:20
  • Hello @Jaiprakash, I ran the following commands `sudo mv /var/lib/mysql/ /home/mysql/` and `sudo chown mysql: mysql /home/mysql/` but the `/var/lib/mysql/` folder is still in the same place, should I delete it? I tried installing `mysql-server`, but the same error message is appearing. What am I doing wrong? – ricardoramos Mar 16 '18 at 04:31
  • Use `sudo mv /var/lib/mysql /home` to move the folder and `sudo chown -R mysql:mysql /home/mysql` to change owner and user group here is another link [https://www.digitalocean.com/community/tutorials/how-to-change-a-mysql-data-directory-to-a-new-location-using-a-symlink] And also reboot your system or remove temporary file before executing the commands – Jaiprakash Khowal Mar 16 '18 at 06:24
1

Probably the hard drive device your your "var" folder is allocated is full filled. You can try to create a symbolic link to your user directory:

mkdir ~/mysql

And then create a symbolic link:

cd /var/lib
sudo rm -rf mysql
sudo ln -s /home/$USER/mysql ./mysql

Finally, try to re-install mysql-server-5.5.

alvaropaco
  • 1,573
  • 18
  • 29