mysql - 无法在 Linux mint 19 中安装 mysql
问题描述
我是 Linux 初学者。昨天,我尝试在我的 Linux mint 笔记本电脑上安装 MySQL。我已成功安装 Apache,但在尝试安装 MySQL 时出现以下错误。
Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
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
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
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (237-3ubuntu10.17) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get purge mysql*
sudo apt-get 自动删除
sudo apt-get 自动清理
sudo apt-get dist-upgrade
我试图再次从网上找到一种方法,但没有任何效果,因此我无法入睡..:(
解决方案
我在 Mint 上安装了 MySQL 无数次,但我最近开始遇到同样的问题 - 完全出乎意料。
试试这里的步骤:
https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
您的 MySQL 服务器将有几个是和否选项。选择适合你的,然后使用sudo mysql 登录,而不仅仅是mysql
sudo mysql -uroot -p
提示将从您的 linux 登录用户变为mysql>
对于自动创建的用户列表:
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
更改 root 用户的身份验证方法,并根据需要分配新密码:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
现在您将能够从 MySQL 工作台访问 MySQL 服务器。老实说,我建议使用它,因为它使您的生活更轻松。
推荐阅读
- android - Android ConstraintLayout 布局视图在彼此之上加上额外的高度
- amazon-web-services - AWS CodePipeline 从 CloudFormation 模板添加 Github 源
- ruby-on-rails - rails 5.2.2 spree 3.6.4 无法更改徽标图像
- oop - OOP中操作和方法的定义
- ansible - 使用 with_sequence 循环时的 Ansible 错误
- postgresql - PostgreSQL:创建触发器以将数据从一个数据库中的表复制到另一个数据库中的表
- angular - 是什么原因:“错误类型错误:无法读取未定义的属性'控件'”?
- javascript - 提交联系表 7 后如何防止在未输入必填字段的情况下重定向到某个 URL
- php - 错误 413:使用 PHP 请求实体太大
- ajax - 断开连接后django通道无效状态错误