如何修复 ubuntu 16.04 LTS 中的这个 mysql 错误?

如何修复 ubuntu 16.04 LTS 中的这个 mysql 错误?
Setting up mysql-server-5.7 (5.7.13-0ubuntu0.16.04.2) ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
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)

我该如何修复这个错误?

答案1

错误消息

debconf:无法初始化前端:对话框 debconf:(对话框前端需要至少 13 行高和 31 列宽的屏幕。)

意思是,您正尝试从一个非常小的终端窗口安装 mysql,该窗口没有所需的高度(和/或宽度)来显示配置 mysql 所需的问题。如果没有正确回答这些问题,mysql 配置文件就无法保存,如果没有配置设置文件,mysql 就会失败。可能您正在使用高度很小的 guake 或类似的东西。

安装 mysql 并设置一个合适大小的终端,回答问题,主要是 root 密码。问题应该解决了。

相关内容