Eu estraguei o MySQL. Preso no ERROR 2002 (HY000) e não é possível reinstalar

0

Ok, então, primeiro, uma história por trás. Eu venho de um ambiente Windows, e eu queria fazer o Ubuntu meu principal ambiente de desenvolvimento. Comecei por instalar a pilha da Lamp e tudo estava bem, exceto quando cheguei ao MySQL. Acho que perdi algo na instalação, mas não consegui acessar o root. Depois de cavar um pouco - e mexer com arquivos -, só consigo acessar mysql> usando o sudo. Mas eu estou acostumado com o phpmyadmin , então eu queria instalar isso. Eu fiz, mas acontece que não consigo acessá-lo porque não consigo sudo da tela de login no meu navegador. Foi quando eu realmente estraguei tudo.

Resumindo, tentei desinstalar tudo depois de tentar editar o usuário root e fiquei completamente bloqueado de mysql> e não consigo voltar. Eu tentei muitas soluções para desinstalá-lo completamente, mas sempre que eu tente apt-get install mysql-server , isso me diz que já está instalado. Quando eu executo mysql ou mysql -uroot etc, eu entendo isso

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Isso porque eu apaguei todos os arquivos.

sudo apt-get install mysql-server me dá isso:

Reading package lists... Done Building dependency tree
Reading state information... Done mysql-server is already the newest version (5.7.12-0ubuntu1.1). 0 upgraded, 0 newly installed, 0 to remove and 275 not upgraded.

Não tenho ideia do que tentar em seguida. Socorro!

EDITAR:

executando sudo apt-get purge mysql*

isonuz@isuntuZ:~$ sudo apt-get purge mysql*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mysqltcl' for glob 'mysql*'
Note, selecting 'mysql-mmm-agent' for glob 'mysql*'
Note, selecting 'mysql-workbench' for glob 'mysql*'
Note, selecting 'mysql-client-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-5.7' for glob 'mysql*'
Note, selecting 'mysql-mmm-tools' for glob 'mysql*'
Note, selecting 'mysql-common-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-5.0' for glob 'mysql*'
Note, selecting 'mysql-server-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-5.7' for glob 'mysql*'
Note, selecting 'mysql-utilities' for glob 'mysql*'
Note, selecting 'mysql-testsuite' for glob 'mysql*'
Note, selecting 'mysql-mmm-common' for glob 'mysql*'
Note, selecting 'mysql-server' for glob 'mysql*'
Note, selecting 'mysql-client' for glob 'mysql*'
Note, selecting 'mysql-sandbox' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.5' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.6' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.7' for glob 'mysql*'
Note, selecting 'mysql-common' for glob 'mysql*'
Note, selecting 'mysql-mmm-monitor' for glob 'mysql*'
Note, selecting 'mysqltuner' for glob 'mysql*'
Note, selecting 'mysql-workbench-data' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-source-5.7' for glob 'mysql*'
Package 'mysql-client-5.5' is not installed, so not removed
Package 'mysql-client-5.6' is not installed, so not removed
Package 'mysql-server-core-5.6' is not installed, so not removed
Package 'mysql-client-core-5.5' is not installed, so not removed
Package 'mysql-client-core-5.6' is not installed, so not removed
Note, selecting 'mysql-common' instead of 'mysql-common-5.6'
Package 'mysql-server-5.5' is not installed, so not removed
Package 'mysql-server-5.6' is not installed, so not removed
Package 'mysql-server-core-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.6' is not installed, so not removed
Package 'mysql-server-5.0' is not installed, so not removed
Package 'mysql-server-5.1' is not installed, so not removed
Package 'mysql-server-core-5.1' is not installed, so not removed
Package 'mysql-mmm-agent' is not installed, so not removed
Package 'mysql-mmm-common' is not installed, so not removed
Package 'mysql-mmm-monitor' is not installed, so not removed
Package 'mysql-mmm-tools' is not installed, so not removed
Package 'mysql-sandbox' is not installed, so not removed
Package 'mysql-utilities' is not installed, so not removed
Package 'mysql-workbench' is not installed, so not removed
Package 'mysql-workbench-data' is not installed, so not removed
Package 'mysqltcl' is not installed, so not removed
Package 'mysqltuner' is not installed, so not removed
Package 'mysql-source-5.7' is not installed, so not removed
Package 'mysql-testsuite' is not installed, so not removed
Package 'mysql-testsuite-5.7' is not installed, so not removed
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
dbconfig-mysql : Depends: mysql-client but it is not going to be installed or mariadb-client but it is not going to be installed or virtual-mysql-client
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

executando sudo apt-get autoremove

isonuz@isuntuZ:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 291 not upgraded.

executando sudo apt-get install lamp-server^ phpmyadmin

isonuz@isuntuZ:~$ sudo apt-get install lamp-server^ phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libhttp-message-perl' for task 'lamp-server'
Note, selecting 'libencode-locale-perl' for task 'lamp-server'
Note, selecting 'php7.0-cli' for task 'lamp-server'
Note, selecting 'mysql-client-5.7' for task 'lamp-server'
Note, selecting 'libapache2-mod-php' for task 'lamp-server'
Note, selecting 'rename' for task 'lamp-server'
Note, selecting 'mysql-server-5.7' for task 'lamp-server'
Note, selecting 'php-common' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'php7.0-opcache' for task 'lamp-server'
Note, selecting 'libcgi-fast-perl' for task 'lamp-server'
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'libhttp-date-perl' for task 'lamp-server'
Note, selecting 'perl-modules-5.22' for task 'lamp-server'
Note, selecting 'liblwp-mediatypes-perl' for task 'lamp-server'
Note, selecting 'libfcgi-perl' for task 'lamp-server'
Note, selecting 'libcgi-pm-perl' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'php7.0-common' for task 'lamp-server'
Note, selecting 'libaio1' for task 'lamp-server'
Note, selecting 'libio-html-perl' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'apache2-data' for task 'lamp-server'
Note, selecting 'libperl5.22' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'libhtml-tagset-perl' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.7' for task 'lamp-server'
Note, selecting 'php7.0-json' for task 'lamp-server'
Note, selecting 'php7.0-readline' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
Note, selecting 'liblua5.1-0' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'libtimedate-perl' for task 'lamp-server'
Note, selecting 'apache2-bin' for task 'lamp-server'
Note, selecting 'perl' for task 'lamp-server'
Note, selecting 'apache2' for task 'lamp-server'
Note, selecting 'php-mysql' for task 'lamp-server'
Note, selecting 'apache2-utils' for task 'lamp-server'
Note, selecting 'libhtml-parser-perl' for task 'lamp-server'
Note, selecting 'libapache2-mod-php7.0' for task 'lamp-server'
Note, selecting 'liburi-perl' for task 'lamp-server'
Note, selecting 'mysql-server-core-5.7' for task 'lamp-server'
Note, selecting 'php7.0-mysql' for task 'lamp-server'
apache2 is already the newest version (2.4.18-2ubuntu3).
apache2-bin is already the newest version (2.4.18-2ubuntu3).
apache2-data is already the newest version (2.4.18-2ubuntu3).
apache2-utils is already the newest version (2.4.18-2ubuntu3).
libaio1 is already the newest version (0.3.110-2).
libapache2-mod-php is already the newest version (1:7.0+35ubuntu6).
libapr1 is already the newest version (1.5.2-3).
libaprutil1 is already the newest version (1.5.4-1build1).
libaprutil1-dbd-sqlite3 is already the newest version (1.5.4-1build1).
libaprutil1-ldap is already the newest version (1.5.4-1build1).
libcgi-fast-perl is already the newest version (1:2.10-1).
libcgi-pm-perl is already the newest version (4.26-1).
libencode-locale-perl is already the newest version (1.05-1).
libfcgi-perl is already the newest version (0.77-1build1).
libhtml-parser-perl is already the newest version (3.72-1).
libhtml-tagset-perl is already the newest version (3.20-2).
libhtml-template-perl is already the newest version (2.95-2).
libhttp-date-perl is already the newest version (6.02-1).
libhttp-message-perl is already the newest version (6.11-1).
libio-html-perl is already the newest version (1.001-1).
liblua5.1-0 is already the newest version (5.1.5-8ubuntu1).
liblwp-mediatypes-perl is already the newest version (6.02-1).
libperl5.22 is already the newest version (5.22.1-9).
libtimedate-perl is already the newest version (2.3000-2).
liburi-perl is already the newest version (1.71-1).
libwrap0 is already the newest version (7.6.q-25).
perl is already the newest version (5.22.1-9).
perl-modules-5.22 is already the newest version (5.22.1-9).
php-common is already the newest version (1:35ubuntu6).
php-mysql is already the newest version (1:7.0+35ubuntu6).
rename is already the newest version (0.20-4).
ssl-cert is already the newest version (1.0.37).
tcpd is already the newest version (7.6.q-25).
libapache2-mod-php7.0 is already the newest version (7.0.4-7ubuntu2.1).
mysql-client-5.7 is already the newest version (5.7.12-0ubuntu1.1).
mysql-client-core-5.7 is already the newest version (5.7.12-0ubuntu1.1).
mysql-common is already the newest version (5.7.12-0ubuntu1.1).
mysql-server is already the newest version (5.7.12-0ubuntu1.1).
mysql-server-5.7 is already the newest version (5.7.12-0ubuntu1.1).
mysql-server-core-5.7 is already the newest version (5.7.12-0ubuntu1.1).
php7.0-cli is already the newest version (7.0.4-7ubuntu2.1).
php7.0-common is already the newest version (7.0.4-7ubuntu2.1).
php7.0-json is already the newest version (7.0.4-7ubuntu2.1).
php7.0-mysql is already the newest version (7.0.4-7ubuntu2.1).
php7.0-opcache is already the newest version (7.0.4-7ubuntu2.1).
php7.0-readline is already the newest version (7.0.4-7ubuntu2.1).
phpmyadmin is already the newest version (4:4.5.4.1-2ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 291 not upgraded.

< < < < RESOLVIDO > > > >

sudo apt-get purge mysql* não estava desinstalando completamente, então eu fiquei louco e fiz

sudo apt-get purge *mysql * *php * *apache * *lamp * (no spacews between the word and the *)
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install lamp-server^
sudo apt-get install phpmyadmin
sudo apt-get install php-mbstring php7.0-mbstring php-gettext

E, claro, fez as configurações necessárias. O problema em última análise foi que eu estava configurando o mysql sem uma senha. Isso funciona no Windows, mas aparentemente não no Ubuntu. Então, eu apenas configurei uma senha para ele desta vez e tudo funcionou como deveria.

    
por Tarek Deeb 12.07.2016 / 09:21

1 resposta

0

sudo apt-get purge mysql * não estava completamente desinstalando, então eu fiquei louco e fiz

sudo apt-get purge *mysql * *php * *apache * *lamp * (no spacews between the word and the *) sudo apt-get autoremove sudo apt-get autoclean sudo apt-get install lamp-server^ sudo apt-get install phpmyadmin sudo apt-get install php-mbstring php7.0-mbstring php-gettext

E, claro, fez as configurações necessárias. O problema em última análise foi que eu estava configurando o mysql sem uma senha. Isso funciona no Windows, mas aparentemente não no Ubuntu. Então, eu apenas configurei uma senha para ele desta vez e tudo funcionou como deveria.

    
por Tarek Deeb 25.10.2016 / 11:04