后续:MySQL 服务不工作。设置新密码后无法访问 PHPMyAdmin

后续:MySQL 服务不工作。设置新密码后无法访问 PHPMyAdmin

我最近问了一个问题这个帖子

我得到了一些帮助,但我的问题没有得到解决。我仍然无法访问 phpmyadmin,mysql 也无法正常运行。这就是我现在的情况。

我运行了这个代码:

$ systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Tue 2017-01-10 09:17:03 CST; 16s ago
Process: 15561 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 15556 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 15561 (code=exited, status=1/FAILURE);         : 15562 (mysql-systemd-s)
CGroup: /system.slice/mysql.service
 └─control
 |─15562 /bin/bash /usr/share/mysql/mysql-systemd-start post
 └─15623 sleep 1

Jan 10 09:17:03 logan-Latitude-E6320 systemd[1]: Starting MySQL Community Server...
Jan 10 09:17:06 logan-Latitude-E6320 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

我之前尝试过卸载并重新安装所有内容。这个过程如下:

logan@logan-Latitude-E6320:~$ sudo rm -f /var/lib/mysql/debian-*.flag
logan@logan-Latitude-E6320:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
   mysql-server-5.7
Suggested packages:
   mailx tinyca
The following NEW packages will be installed:
  mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 195 not upgraded.
3 not fully installed or removed.
Need to get 0 B/2,597 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 230105 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.16-0ubuntu0.16.04.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2) ...
Setting up mysql-server-core-5.7 (5.7.16-0ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.16-0ubuntu0.16.04.1) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/logrotate.d/mysql-server ...
Installing new version of config file /etc/mysql/debian-start ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
update-alternatives: warning: not replacing /etc/mysql/my.cnf with a link
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 libc-bin (2.23-0ubuntu3) ...
 Processing triggers for systemd (229-4ubuntu10) ...
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)

我认为该问题出在 /usr/bin/dpkg(因为它返回了错误代码,但我不知道如何解决该问题。有人知道要采取什么步骤才能解决问题吗?

欢迎任何建议,我提前感谢您的帮助。

如果您需要任何更多信息,请告诉我。

编辑 1:此问题已被确定为另一个问题的可能重复。那个可能的重复是我之前问过的问题,但并未给出问题的解决方案。

答案1

我不确定你做了什么,如果你更改了 mysql 密码,你需要更改 phpadmin 存储在文件“config.inc.php”中的访问 PHP 的密码。

您可以在这里阅读一些内容。如何更改 mysql 和 phpmyadmin 的 root 密码

相关内容