我已经尝试了所有相关内容,我可以在这里找到回答
但到目前为止,这个问题还没有得到解决。我从来没有成功安装过 mysql。因为我phpmyadmin
在安装 mysql 之前尝试过安装,这意味着我中止了phpadmin
安装,然后奇怪的是,在mysql-server
安装过程中phpmyadmin
弹出了配置屏幕。
所以很乱 :D
hutber@hutber:~$ ps -ef | grep mysql
999 3952 3925 0 12:51 ? 00:00:36 mysqld
hutber 27307 27070 0 23:56 pts/2 00:00:00 grep --color=auto mysql
hutber@hutber:~$ sudo apt-get purge mysql*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mysqltcl' for glob 'mysql*'
Note, selecting 'mysql-workbench' for glob 'mysql*'
Note, selecting 'mysql-client-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-5.7' for glob 'mysql*'
Note, selecting 'mysql-common-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-5.0' for glob 'mysql*'
Note, selecting 'mysql-server-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-5.7' for glob 'mysql*'
Note, selecting 'mysql-utilities' for glob 'mysql*'
Note, selecting 'mysql-testsuite' for glob 'mysql*'
Note, selecting 'mysql-server' for glob 'mysql*'
Note, selecting 'mysql-client' for glob 'mysql*'
Note, selecting 'mysql-sandbox' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.5' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.6' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.7' for glob 'mysql*'
Note, selecting 'mysql-common' for glob 'mysql*'
Note, selecting 'mysqltuner' for glob 'mysql*'
Note, selecting 'mysql-workbench-data' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-source-5.7' for glob 'mysql*'
Package 'mysql-client-5.5' is not installed, so not removed
Package 'mysql-client-5.6' is not installed, so not removed
Package 'mysql-server-core-5.6' is not installed, so not removed
Package 'mysql-client-core-5.5' is not installed, so not removed
Package 'mysql-client-core-5.6' is not installed, so not removed
Note, selecting 'mysql-common' instead of 'mysql-common-5.6'
Package 'mysql-server-5.5' is not installed, so not removed
Package 'mysql-server-5.6' is not installed, so not removed
Package 'mysql-server-core-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.6' is not installed, so not removed
Package 'mysql-server-5.0' is not installed, so not removed
Package 'mysql-server-5.1' is not installed, so not removed
Package 'mysql-server-core-5.1' is not installed, so not removed
Package 'mysql-common' is not installed, so not removed
Package 'mysql-sandbox' is not installed, so not removed
Package 'mysql-utilities' is not installed, so not removed
Package 'mysql-workbench' is not installed, so not removed
Package 'mysql-workbench-data' is not installed, so not removed
Package 'mysqltcl' is not installed, so not removed
Package 'mysqltuner' is not installed, so not removed
Package 'mysql-client' is not installed, so not removed
Package 'mysql-client-5.7' is not installed, so not removed
Package 'mysql-client-core-5.7' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
Package 'mysql-server-5.7' is not installed, so not removed
Package 'mysql-server-core-5.7' is not installed, so not removed
Package 'mysql-source-5.7' is not installed, so not removed
Package 'mysql-testsuite' is not installed, so not removed
Package 'mysql-testsuite-5.7' is not installed, so not removed
The following package was automatically installed and is no longer required:
libevent-core-2.1-6
Use 'sudo apt autoremove' to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
hutber@hutber:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
libevent-core-2.1-6
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
After this operation, 251 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 342618 files and directories currently installed.)
Removing libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
hutber@hutber:~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
hutber@hutber:~$ sudo apt-get install mysql-server --fix-missing --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
mailx tinyca
Recommended packages:
libhtml-template-perl
The following NEW packages will be installed
libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 to upgrade, 7 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/20.4 MB of archives.
After this operation, 160 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 342614 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.4_all.deb ...
Unpacking mysql-common (5.8+1.0.4) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-core-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Selecting previously unselected package libevent-core-2.1-6:amd64.
Preparing to unpack .../libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb ...
Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Setting up mysql-common (5.8+1.0.4) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 342775 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.27-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.27-0ubuntu0.18.04.1) ...
Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Setting up mysql-server-core-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Setting up mysql-client-core-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Setting up mysql-client-5.7 (5.7.27-0ubuntu0.18.04.1) ...
Setting up mysql-server-5.7 (5.7.27-0ubuntu0.18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates it's a follow-up error from a previous failure.
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
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.29) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
编辑2
hutber@hutber:~$ sudo apt install mysql-server-5.7 phpmyadmin --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
dbconfig-common dbconfig-mysql libjs-sphinxdoc libjs-underscore php php-php-gettext php-phpseclib php7.2
Suggested packages:
php-libsodium php-mcrypt php-gmp
Recommended packages:
javascript-common php-gd php-bz2 php-zip php-tcpdf
The following NEW packages will be installed
dbconfig-common dbconfig-mysql libjs-sphinxdoc libjs-underscore php php-php-gettext php-phpseclib php7.2 phpmyadmin
0 to upgrade, 9 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/4,813 kB of archives.
After this operation, 28.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
E: Internal Error, No file name for mysql-server-5.7:amd64```
答案1
打开终端并输入:
sudo dpkg--configure-a# 指示 dpkg “修复”自身 sudo apt-get -f 安装# 更正依赖关系并继续配置你的软件包 sudo apt 安装 mysql-server-5.7 phpmyadmin --reinstall
关于E: Internal Error, No file name for mysql-server-5.7:amd64
错误信息,请搜索答案E:内部错误,没有 mysql-server-5.7:amd64 的文件名。
答案2
一直在努力解决这个问题,并且这样做了:
sudo apt purge mysql*
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt autoremove
sudo apt install mysql-server-5.7 phpmyadmin
出现一个对话框,我选择“忽略”,它似乎起作用了。至少 Mysql 和 web 服务都运行正常了。