Ubuntu 16.04 LAMP MySQL dpkg 安装问题

Ubuntu 16.04 LAMP MySQL dpkg 安装问题

LAMP Ubuntu 16.04 MySQL服务器安装问题

尝试按照以下说明在 Ubuntu 16.04 上设置 LAMP 系统。howtoforge ubuntu_lamp_for_newbies Apache 和 PHP 安装并测试良好。MariaDB 加载并测试良好,但无法使 phpMyAdmin 工作。

尝试按照 LAMP 安装说明进行操作:digitalocean how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

尝试移除并重新加载。 如何在 ubuntu 15.10 上安装或卸载半安装的 mysql-client-5.6? 如何在 ubuntu 15.10 上安装或卸载半安装的 mysql-client-5.6?

 Richard Uijen has suggested: ( changed for server 5.7)

sudo apt-get --purge remove mysql*
sudo apt-get autoremove mysql*
sudo rm -rf /etc/mysql/
sudo rm -rf /var/lib/mysql/
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall mysql-server-5.7

有包安装错误(也搞乱了其他包的安装),报告的错误得到了先前的问题答复,与 MySQL 安装和之前的 MariaDB 安装发生冲突。 https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071 MySQL 5.6 拒绝安装在已安装 MariaDB 10.0 的系统上,从而阻止用户在没有手动干预的情况下恢复到 MySQL(又名 mysql 标志文件系统需要重新设计)

尝试删除对两者的任何引用。(mariadb* 和 mysql*)解决了包错误。

尝试重新安装 MySQL:

sudo apt-get install mysql-server

mysql-server is already the newest version (5.7.12-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 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) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 2
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)

当前状态:

mysql -u root -p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

: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 Tue 2016-05-24 07:12:23 CDT; 2h 45min ago

 systemd[1]: Failed to start MySQL Community Server.

/etc/mysql does not exist.

现在很亏吗?

答案1

我遇到过同样的问题。在 /etc/mysql/ 目录中查找文件名中带有“deb10flag”的文件。(我记不清我执行此操作时文件的具体名称,因为那是一个月前的事了。)我通过删除带有 debian10flag 的文件解决了这个问题。此设置由 MariaDB 安装生成(它将 deb 标志设置为版本 10)。我删除了 /etc/mysql/ 并从 bin 中清除了它的任何痕迹。完成所有这些操作后,软件包存储库中的 mysql 设置存在依赖关系问题。mysql-cli 和 mysql-server 都依赖于 mysql-common。通过按以下顺序安装它们(我认为)可以解决这个问题:(1)mysql-common,(2)mysql-cli,(3)mysql-server。

**我知道这不清楚。我会回复我修复此问题的具体步骤(很快)。但问题涉及 deb10flag 和依赖性问题。

https://askubuntu.com/a/766094/407584同一问题

相关内容