mysql - MySQL Ubuntu 19.10 安装错误 - 系统架构目录不存在
问题描述
我试图在我的 ubuntu19.10 安装上进行 MySQL 的全新安装但是在安装过程中,我在尝试在 Ubuntu 191.10 上安装 MySql 时继续收到以下错误。
在 /var/log/MySql/error.log 中:
2020-03-31T02:04:00.133031Z 1 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement 'CREATE SCHEMA mysql DEFAULT COLLATE utf8mb4_0900_ai_ci' failed with error code = 1049, error message = 'System schema directory does not exist.'.
2020-03-31T02:04:00.133738Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-03-31T02:04:00.134159Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-03-31T02:04:00.662756Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19-0ubuntu0.19.10.3) (Ubuntu).
安装会出现以下错误:
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (8.0.19-0ubuntu0.19.10.3).
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 mysql-server-8.0 (8.0.19-0ubuntu0.19.10.3) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
2020-03-31T02:04:00.134301Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2020-03-30 21:04:03 CDT; 9ms ago
Process: 17035 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Mar 30 21:04:03 ubuntu-vm systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Mar 30 21:04:03 ubuntu-vm systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 30 21:04:03 ubuntu-vm systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
解决方案
尝试先安装 mariadbsudo apt install mariadb-server
在此之后您可以正常使用 mysql 但如果您有任何错误尝试使用以下命令重新安装 mysql :sudo apt install mysql-server
Mariadb 和 MySQL 一样,只是 oracle 收购 MySQL 后的开源项目,所以有员工退出 MySQL 去创建一个新的 SGBD,它对 MySQL 的兼容性很高。
推荐阅读
- c# - MVC .net 控制器未从视图接收 POST 数据
- sql - 加入并获取另一个表中的最后一条记录
- java - 无法验证具有命名空间的 XML 的 XSD
- java - 在 lambda 中的枚举构造函数中访问同一类的枚举不会编译
- node.js - 如何使用 Node.js 将转换后的预训练 keras 模型加载到 Tensorflow.js?
- android - 将 WebView URL 的文本颜色更改为白色
- bash - 如何使用 bash 脚本将文件的副本放在所有文件夹中?
- javascript - Moment JS - isAfter 返回 .isAfter 不是函数吗?
- java - PreparedStatement 在传递给 setString 的字符串周围给出两个单引号
- android - PUT 上传文件到 AWS S3 预签名 URL Retrofit2 Android