![卡在 apt-get](https://linux22.com/image/1147077/%E5%8D%A1%E5%9C%A8%20apt-get%20.png)
我的系统出现问题,由于依赖项未满足,我无法使用 apt-get 安装或删除程序,但是我无法安装依赖项,因为我一直收到错误:
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:
galera-3 libdbi-perl mysql-server mysql-server-5.7
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
plesk-config-troubleshooter psa-imp
0 upgraded, 0 newly installed, 2 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 20.4 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 118238 files and directories currently installed.)
Removing psa-imp (6.2.17-ubuntu16.04.build1705170314.14) ...
dpkg action:
Trying to start service mysql... /usr/sbin/mysqld is stopped
done
Trying to establish test connection... ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
只是 Trying to establish test connection... ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
重复多次才说
failed
ERROR while trying to establish test connection
Check the error reason(see log file: /var/log/plesk/install/plesk_17.5.3_installation.log), fix and try again
establish test connection
***** installing problem report *****
ERROR while trying to establish test connection
Check the error reason(see log file: /var/log/plesk/install/plesk_17.5.3_installation.log), fix and try again
establish test connection
dpkg: error processing package plesk-config-troubleshooter (--remove):
subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
psa-imp
plesk-config-troubleshooter
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: Operation was interrupted before it could finish
该问题与 mysql 有关,因为当我尝试从任何帐户运行 mysql 时,无论是用户帐户、管理员还是 root,我都会收到相同的错误(使用不同的用户名)。在互联网上寻找修复方法后,我尝试使用:mysqld --skip-grant-tables
然后是mysql -u root mysql
,但我只收到相同的错误ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
。我也尝试过mysql -hxxx.xxx.xxx.xxx -uroot -p
并收到此错误:ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)
(ip 替换为 xxx)
我也尝试过编辑/etc/my.cnf
我在另一篇 SO 帖子中找到的内容,但是文件是空的,并且sudo dpkg-reconfigure mysql-server
应该重置 root 密码,但这没有帮助。
答案1
似乎我的 sql 已停止,请尝试启动服务,然后重新运行。这是因为 mysql 已停止,所以您无法登录 mysql。您可以通过 或 来启动 mysql(sudo service mysql start
如果/etc/init.d/ mysql start
它有 init 脚本)。