ubuntu安装mysql报错:dpkg: error processing package mysql-server (--configure)

ubuntu安装mysql过程中电脑突然关机,重新安装一直报错:

Renaming removed key_buffer and myisam-recover options (if present)
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since 六 2018-09-15 17:48:10 CST; 33ms ago
  Process: 32098 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 32097 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 32089 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 32097 (code=exited, status=1/FAILURE)
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mysql-client (5.7.23-0ubuntu0.16.04.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
Processing triggers for libc-bin (2.23-0ubuntu10) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
dell@dell-virtual-machine:~$ dpkg: error processing package mysql-server (--configure):

解决方法:

sudo rm /var/lib/mysql/ -R

sudo rm /etc/mysql/ -R

sudo apt-get autoremove mysql* --purge

sudo apt-get install mysql-server mysql-client

你可能感兴趣的:(配置管理)