我正在尝试按如下方式安装 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)
那么问题是什么以及如何解决这个问题?
答案1
您看到的错误是之前尝试升级 mariadb 时出错的结果。可能您也在那里输入了错误的 root 密码,导致升级过程无法正常完成。
升级的一部分正在进行,mysql_upgrade
以将系统表更新为新版本所需的架构。您看到的错误 1054 表示在最近的升级后尚未完成此操作。
这反过来会导致 mariadb 无法启动,并导致包保持未配置状态。因此,首先解决根本原因:运行mysql_upgrade
。
不幸的是,此命令要求 mariadb 已启动并运行,因此您现在面临一个先有鸡还是先有蛋的问题。我相信您可以使用 mysqld 的--skip-grant-tables
选项来解决鸡的问题,但我对此并不 100% 确定。
答案2
我可能会看看这个:
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'