升级到 16.04 后 Apache2 和 Mysql 出现问题

升级到 16.04 后 Apache2 和 Mysql 出现问题

安装 Ubuntu 16.04 后,我无法再从 h-ttp://localhost/phpmyadmin 访问我的 Mysql 服务器。我尝试卸载并安装 mysql,但没有成功。

我发现问题出在 apache2 内部(运行 h-ttp://localhost 浏览器出现服务器错误)并且与 php 有关,所以我跟进了这个问题修复了这个问题。现在 apache2 可以正确运行了http://本地主机

此时我尝试重新安装mysql但出现错误:

giuseppecanto@acerAspire5750g:~$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libdbd-mysql-perl libmysqlclient20 linux-image-4.2.0-35-generic linux-image-extra-4.2.0-35-generic mariadb-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/10,1 MB of archives.
After this operation, 94,5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Selecting previously unselected package mysql-server-core-5.7.
(Reading database ... 312338 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-5.7_5.7.12-0ubuntu1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.12-0ubuntu1) ...
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../mysql-server-5.7_5.7.12-0ubuntu1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.12-0ubuntu1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-server-core-5.7 (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
insserv: warning: script 'oracle-xe' missing LSB tags and overrides
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.
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 systemd (229-4ubuntu4) ...
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)

phpmyadmin 安装请求中也出现该错误:

giuseppecanto@acerAspire5750g:~$ sudo apt-get install phpmyadmin 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
phpmyadmin is already the newest version (4:4.5.4.1-2ubuntu1).
The following packages were automatically installed and are no longer required:
  libdbd-mysql-perl libmysqlclient20 linux-image-4.2.0-35-generic linux-image-extra-4.2.0-35-generic mariadb-common
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
insserv: warning: script 'oracle-xe' missing LSB tags and overrides
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.
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.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行 systemctl status mysql.service 出现以下情况:

giuseppecanto@acerAspire5750g:~$ systemctl status mysql.service
mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since sab 2016-05-07 11:07:17 CEST; 7min ago
  Process: 9703 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)

mag 07 11:07:17 acerAspire5750g systemd[1]: Failed to start MySQL Community Server.
mag 07 11:07:17 acerAspire5750g systemd[1]: mysql.service: Unit entered failed state.
mag 07 11:07:17 acerAspire5750g systemd[1]: mysql.service: Failed with result 'exit-code'.
mag 07 11:07:17 acerAspire5750g systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
mag 07 11:07:17 acerAspire5750g systemd[1]: Stopped MySQL Community Server.
mag 07 11:07:17 acerAspire5750g systemd[1]: mysql.service: Start request repeated too quickly.
mag 07 11:07:17 acerAspire5750g systemd[1]: Failed to start MySQL Community Server.

我的目的是正确使用 phpmyadmin。也许我必须全部卸载?

相关内容