A instalação do servidor MySQL não é concluída

1

Quando executo o comando, sudo apt-get install mysql-server , recebo os seguintes erros ...

Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libevent-core-2.0-5 mysql-client-5.7 mysql-common mysql-server-5.7
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  libevent-core-2.0-5 mysql-client-5.7 mysql-common mysql-server
  mysql-server-5.7
0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded.
Need to get 0 B/4,497 kB of archives.
After this operation, 82.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 288832 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.21-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-common (5.7.21-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Selecting previously unselected package libevent-core-2.0-5:amd64.
Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_amd64.deb ...
Unpacking libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up mysql-common (5.7.21-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 288884 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.21-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.21-0ubuntu0.16.04.1) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-client-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
mysql_upgrade: Got error: 1524: Plugin 'unix_socket' is not loaded while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                      Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu li muitos fóruns e sites antes de postar aqui. A lista de coisas que já experimentei:

  1. Erro 1524 no mysql do Ubuntu 15.10 - unix_socket | Pergunte ao Ubuntu
  2. Alterou o arquivo my.conf
  3. arquivos mysql-* removidos, reinstalados
  4. Configure o servidor MySQL no Ubuntu | rackspace.com

Eu estou realmente presa, então seria imensamente útil se alguém me guiasse dessa maneira.

    
por Chintan Mehta 12.04.2018 / 09:17

2 respostas

1

Tente estes. Espero que ajude.

sudo apt-get remove --purge mysql*
sudo apt-get purge mysql* 
sudo apt-get autoremove 
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
sudo apt-get install mysql-server
    
por surjit 12.04.2018 / 09:32
0

Eu finalmente consegui resolver o problema removendo todas as dependências e arquivos de configuração do mysql, assim como do maria-db primeiro. Para fazer isso, vá para /var/lib e delete todos os arquivos relacionados ao mysql (você terá que ter permissões de root para deletá-los, então não esqueça de escrever sudo su antes disso). Você pode excluir todos os arquivos digitando rm -r /var/lib/mysql* .
Depois disso, você terá que apagar todos os arquivos no diretório / etc digitando rm -r /etc/mysql*

Em seguida, execute os seguintes comandos e você estará pronto para ir:

sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server
sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install
sudo apt install mysql-server
    
por Chintan Mehta 12.04.2018 / 11:25