我正在尝试为自己设置一个云服务器。在此过程中,我尝试安装 MySQL,但当我去安装时,我得到了这个
forReading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libevent-core-2.1-7 libmecab2MariaDB
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libfcgi-perl libhtml-template-perl libmysqlclient21 libreadline5 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server-10.3
mariadb-server-core-10.3
Suggested packages:
libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test
tinyca
The following packages will be REMOVED:
mysql-client-8.0 mysql-client-core-8.0 mysql-server-8.0 mysql-server-core-8.0
The following NEW packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libfcgi-perl libhtml-template-perl libmysqlclient21 libreadline5 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server mariadb-server-10.3
mariadb-server-core-10.3
0 upgraded, 17 newly installed, 4 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/20.5 MB of archives.
After this operation, 17.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 589674 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试解决这个问题,很多遇到此问题的表单都说删除所有 sql 文件,我尝试删除这些文件并清除它们。我还尝试了 sudo apt-get -f install,但什么也没得到。我去安装并得到相同的输出。由于错误说它来自 mysql-server-8.0,所以我去我的日志并得到这个,
2020-07-26 15:35:18 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2020-07-26 15:35:18 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-07-26 15:35:19 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-07-26 15:35:19 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-07-26 15:35:19 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-07-26 15:35:19 0 [ERROR] Aborting
2020-07-26 15:35:21 0 [Note] InnoDB: Using Linux native AIO
2020-07-26 15:35:21 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-26 15:35:21 0 [Note] InnoDB: Uses event mutexes
2020-07-26 15:35:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-26 15:35:21 0 [Note] InnoDB: Number of pools: 1
2020-07-26 15:35:21 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-07-26 15:35:21 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-07-26 15:35:21 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-26 15:35:21 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-26 15:35:21 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2020-07-26 15:35:21 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-07-26 15:35:21 0 [Note] InnoDB: Starting shutdown...
2020-07-26 15:35:22 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-07-26 15:35:22 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-07-26 15:35:22 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-26 15:35:22 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-07-26 15:35:22 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-07-26 15:35:22 0 [ERROR] Aborting
我尝试删除之前安装的所有内容,例如 MariaDB,但当我重新安装时,出现了此问题
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libevent-core-2.1-7 libmecab2
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libfcgi-perl libhtml-template-perl libmysqlclient21 libreadline5 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server-10.3
mariadb-server-core-10.3
Suggested packages:
libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test
tinyca
The following packages will be REMOVED:
mysql-client-8.0 mysql-client-core-8.0 mysql-server-8.0 mysql-server-core-8.0
The following NEW packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libfcgi-perl libhtml-template-perl libmysqlclient21 libreadline5 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server mariadb-server-10.3
mariadb-server-core-10.3
0 upgraded, 17 newly installed, 4 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/20.5 MB of archives.
After this operation, 17.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 589674 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我认为同样的问题导致了这种情况,因为它提到了 mysql-server-8.0。我非常希望得到一些帮助。请随时索取其他可能有帮助的日志文件。谢谢!