我正在尝试像下面那样安装MariaDB
sudo apt install mariadb-server Reading package lists... Done Building dependency tree Reading state information... Done mariadb-server is already the newest version (10.1.20+maria-1~xenial). The following package was automatically installed and is no longer required: libevent-core-2.0-5 Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 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 mariadb-server-10.1 (10.1.20+maria-1~xenial) ...
2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Compressed tables use zlib 1.2.8 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Using Linux native AIO 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Using SSE crc32 instructions 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Completed initialization of buffer pool 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Highest supported file format is Barracuda. 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: The log sequence numbers 1607324 and 1607324 in ibdata files do not match the log sequence number 1607334 in the ib_logfiles! 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Database was not shutdown normally! 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Starting crash recovery. 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Reading tablespace information from the .ibd files... 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Restoring possible half-written data pages 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: from the doublewrite buffer... 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: 128 rollback segment(s) are active. 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Waiting for purge to start 2016-12-23 16:02:33 140016351164672 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 1607334 2016-12-23 16:02:33 140015623444224 [Note] InnoDB: Dumping buffer pool(s) not yet started 2016-12-23 16:02:33 140016351164672 [Note] Plugin 'FEEDBACK' is disabled. 2016-12-23 16:02:33 140016351164672 [Note] Recovering after a crash using tc.log 2016-12-23 16:02:33 140016351164672 [Note] Starting crash recovery... 2016-12-23 16:02:33 140016351164672 [Note] Crash recovery finished. ERROR: 1054 Unknown column 'password' in 'field list' 2016-12-23 16:02:33 140016351164672 [ERROR] Aborting Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details. invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing package mariadb-server-10.1 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mariadb-server: mariadb-server depends on mariadb-server-10.1 (= 10.1.20+maria-1~xenial); however: Package mariadb-server-10.1 is not configured yet. dpkg: error processing package mariadb-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: mariadb-server-10.1 mariadb-server E: Sub-process /usr/bin/dpkg returned an error code (1)
那么是什么问题,以及如何解决这个问题呢?
您看到的错误是早期尝试升级mariadb期间错误的结果。 可能你也错误地input了root密码,升级过程没有正确完成。
部分升级正在运行mysql_upgrade以将系统表更新为新版本预期的模式。 您看到的错误1054表示最近一次升级后没有完成。
这反过来导致mariadb无法启动,导致软件包保持未configuration状态。 所以先修复根本原因:运行mysql_upgrade 。
不幸的是,这个命令要求mariadb正常运行,所以你现在有一个鸡蛋和鸡蛋的问题。 我相信你可以用mysqld的--skip-grant-tables选项来杀死鸡,但是我不能100%确定那个。
我可能会看看这个:
dpkg: dependency problems prevent configuration of mariadb-server: mariadb-server depends on mariadb-server-10.1 (= 10.1.20+maria-1~xenial); however: Package mariadb-server-10.1 is not configured yet.
不知道你有什么依赖性问题,应该有一个日志文件,提供更多的信息。 还有以下问题,我试图卸载,更新您的回购,并尝试解决依赖性问题(假设这是一个实际问题)。 然后重新安装maria-db并设置密码和相应的用户。
这是导致它崩溃的原因:
ERROR: 1054 Unknown column 'password' in 'field list'