Estou executando o MySQL 5.7.19, sob o LAMP, em dois Ubuntu 16.04. Esta é uma instância do AWS EC2.
Já faz algum tempo que eu instalei o MySQL e não o usei, então não seria um problema se eu o reinstalasse. Nada que eu insiro para a senha de root funciona.
Eu tentei
sudo /etc/init.d/mysql stop
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
sudo mysql -u root
Resultou em
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Eu então tentei o procedimento descrito aqui . Quando entrei
sudo apt-get install mysql-server
Eu tenho
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-generic : Depends: linux-headers-4.4.0-119-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Quando eu entro
ps -aux | grep mysql
o resultado é
ubuntu 27152 0.0 0.0 12948 984 pts/1 S+ 12:30 0:00 grep --color=auto mysql
Quando eu entro
mysql -u root -p
Eu obtenho
Enter password:
Então o mysql não foi desinstalado e não consigo reconfigurá-lo.
Atualização 1:
Quando eu corri
sudo dpkg-reconfigure mysql-server-5.7
Eu tenho
update-alternatives: warning: forcing reinstallation of alternative
/etc/mysql/mysql.cnf because link group my.cnf is broken
update-alternatives: warning: not replacing /etc/mysql/my.cnf with a link
mysql_upgrade: [ERROR] unknown option '--~'
Upgrade process encountered error and will not continue.
mysql -u root -p
resulta em
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Editar 2
Eu tentei o seguinte com os resultados associados.
ubuntu@ip-10-0-1-73:~$ sudo apt autoremove --purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-generic : Depends: linux-headers-4.4.0-119-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ubuntu@ip-10-0-1-73:~$ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-generic : Depends: linux-headers-4.4.0-119-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Rodando
apt-get -f install
não mudou nada.
Editar 3:
Se eu usar
sudo mysql -u root
leva-me ao mysql. Se eu usar o switch -p, ele aceita qualquer coisa como uma senha. No entanto, quando eu entro
mysql> UPDATE mysql.user SET authentication_string=PASSWORD('newPassword') WHERE User='root';
Eu obtenho
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
Warning (Code 1681): 'PASSWORD' is deprecated and will be removed in a future release.
Eu então inseri
FLUSH PRIVILEGES;
e recebi a seguinte mensagem
Query OK, 0 rows affected (0.00 sec)
Eu saí e ainda obtenho o mesmo resultado se eu não usar o sudo
mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Editar 4:
Eu tentei o seguinte com os resultados seguintes.
$ sudo apt install linux-headers-4.4.0-119-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-4.4.0-119-generic : Depends: linux-headers-4.4.0-119 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ubuntu@ip-10-0-1-73:~$ sudo apt-get -f install linux-headers-4.4.0-119- generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-4.4.0-119-generic : Depends: linux-headers-4.4.0-119 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-64 linux-headers-4.4.0-64-generic linux-headers-4.4.0- 66 linux-headers-4.4.0-66-generic linux-headers-4.4.0-70 linux-headers-4.4.0-70-generic
linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic linux-headers-4.4.0- 72 linux-headers-4.4.0-72-generic linux-headers-4.4.0-75 linux-headers-4.4.0-75- generic
linux-headers-4.4.0-78 linux-headers-4.4.0-78-generic linux-headers-4.4.0- 79 linux-headers-4.4.0-79-generic linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic
linux-headers-4.4.0-83 linux-headers-4.4.0-83-generic linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic linux-headers-4.4.0-89 linux-headers-4.4.0-89-generic
linux-headers-4.4.0-91 linux-headers-4.4.0-91-generic linux-headers-4.4.0-92 linux-headers-4.4.0-92-generic linux-image-4.4.0-112-generic
linux-image-4.4.0-64-generic linux-image-4.4.0-66-generic linux-image- 4.4.0-70-generic linux-image-4.4.0-71-generic linux-image-4.4.0-72-generic
linux-image-4.4.0-75-generic linux-image-4.4.0-78-generic linux-image-4.4.0-79-generic linux-image-4.4.0-81-generic linux-image-4.4.0-83-generic
linux-image-4.4.0-87-generic linux-image-4.4.0-89-generic linux-image-4.4.0-91-generic linux-image-4.4.0-92-generic linux-image-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
linux-headers-4.4.0-119 linux-headers-4.4.0-119-generic
The following NEW packages will be installed:
linux-headers-4.4.0-119 linux-headers-4.4.0-119-generic
0 upgraded, 2 newly installed, 0 to remove and 224 not upgraded.
10 not fully installed or removed.
Need to get 0 B/10.8 MB of archives.
After this operation, 78.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 512472 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-119_4.4.0-119.143_all.deb ...
Unpacking linux-headers-4.4.0-119 (4.4.0-119.143) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0- 119_4.4.0-119.143_all.deb (--unpack):
unable to create '/usr/src/linux-headers-4.4.0- 119/include/linux/cpufeature.h.dpkg-new' (while processing './usr/src/linux- headers-4.4.0-119/include/linux/cpufeature.h'): No space left on device
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../linux-headers-4.4.0-119-generic_4.4.0- 119.143_amd64.deb ...
Unpacking linux-headers-4.4.0-119-generic (4.4.0-119.143) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0- 119-generic_4.4.0-119.143_amd64.deb (--unpack):
unable to create '/usr/src/linux-headers-4.4.0-119- generic/include/config/rtc/drv/88pm860x.h.dpkg-new' (while processing './usr/src/linux-headers-4.4.0-119-generic/include/config/rtc/drv/88pm860x.h'): No space left on device
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-4.4.0-119_4.4.0-119.143_all.deb
/var/cache/apt/archives/linux-headers-4.4.0-119-generic_4.4.0- 119.143_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
$df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 498080 0 498080 0% /dev
tmpfs 101440 12068 89372 12% /run
/dev/xvda1 8117828 5515716 2166836 72% /
tmpfs 507184 0 507184 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 507184 0 507184 0% /sys/fs/cgroup
tmpfs 101444 0 101444 0% /run/user/1000