![如何修复 ubuntu 16.04 LTS 中的这个 mysql 错误?](https://linux22.com/image/885632/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%20ubuntu%2016.04%20LTS%20%E4%B8%AD%E7%9A%84%E8%BF%99%E4%B8%AA%20mysql%20%E9%94%99%E8%AF%AF%EF%BC%9F.png)
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 密码。问题应该解决了。