相关链接:
在 CentOS 1804 中 使用 yum 安装 MySQL 5.7 最新版
在 CentOS 1804 中 安装 MySQL 5.7.20 (或任意MySQL版本)
在 CentOS 1804 中 修改 MySQL 密码策略
在 CentOS 中 开启 MySQL 的 3306 端口
在不打开 MySQL 3306 端口的情况下,使用 Navicat 进项远程连接(使用22端口)
在 Ubuntu 中安装 MySQL5.7.20(任意版本)
在 Ubuntu 中安装 MySQL5.7.** 最新版
CentOS 6/7 安装 MySQL 8 最新版
CentOS 6/7 安装 MySQL 8.0.11 (或任意版)
MySQL 5.7 最新版 使用 yum 安装 MySQL NDB Cluster 7.5 最新版 集群
MySQL 集群 MySQL NDB Cluster 7.5.** 与 MySQL 5.7.** 对应版本说明
MySQL 集群 MySQL NDB Cluster 7.6.** 与 MySQL 5.7.** 对应版本说明
MySQL 5.7.20 (或指定版本) 与 MySQL NDB Cluster 7.6.4 (或指定版本) 集群
Windows 安装 MySQL 5.7.20 教程(及常见问题解决)
MySQL 5.7.20 (或任意版本) 的 Windows 版 安装程序 (msi) 下载
本示例使用的安装技术来源于官方文档:
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
安装准备:
root@csdn:/usr/java# dpkg -i mysql-common_5.7.20-1ubuntu17.10_amd64.deb
Selecting previously unselected package mysql-common.
(Reading database ... 102189 files and directories currently installed.)
Preparing to unpack mysql-common_5.7.20-1ubuntu17.10_amd64.deb ...
Unpacking mysql-common (5.7.20-1ubuntu17.10) ...
Setting up mysql-common (5.7.20-1ubuntu17.10) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
root@csdn:/usr/java#
root@csdn:/usr/java# dpkg -i mysql-community-client_5.7.20-1ubuntu17.10_amd64.deb
Selecting previously unselected package mysql-community-client.
(Reading database ... 102204 files and directories currently installed.)
Preparing to unpack mysql-community-client_5.7.20-1ubuntu17.10_amd64.deb ...
Unpacking mysql-community-client (5.7.20-1ubuntu17.10) ...
dpkg: dependency problems prevent configuration of mysql-community-client:
mysql-community-client depends on libaio1 (>= 0.3.93); however:
Package libaio1 is not installed.
dpkg: error processing package mysql-community-client (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.8.3-2) ...
Errors were encountered while processing:
mysql-community-client
root@csdn:/usr/java#
去阿里云开源镜像站(链接:https://opsx.alibaba.com/mirror)下载在对应的包。root@csdn:/usr/java# dpkg -i libaio1_0.3.109-4_amd64.deb
Selecting previously unselected package libaio1:amd64.
(Reading database ... 102261 files and directories currently installed.)
Preparing to unpack libaio1_0.3.109-4_amd64.deb ...
Unpacking libaio1:amd64 (0.3.109-4) ...
Setting up libaio1:amd64 (0.3.109-4) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
让我们在此安装一下第二个包: root@csdn:/usr/java# dpkg -i mysql-community-client_5.7.20-1ubuntu17.10_amd64.deb
(Reading database ... 102268 files and directories currently installed.)
Preparing to unpack mysql-community-client_5.7.20-1ubuntu17.10_amd64.deb ...
Unpacking mysql-community-client (5.7.20-1ubuntu17.10) over (5.7.20-1ubuntu17.10) ...
Setting up mysql-community-client (5.7.20-1ubuntu17.10) ...
Processing triggers for man-db (2.8.3-2) ...
root@csdn:/usr/java#
此时便没有错误了。root@csdn:/usr/java# dpkg -i mysql-client_5.7.20-1ubuntu17.10_amd64.deb
Selecting previously unselected package mysql-client.
(Reading database ... 102268 files and directories currently installed.)
Preparing to unpack mysql-client_5.7.20-1ubuntu17.10_amd64.deb ...
Unpacking mysql-client (5.7.20-1ubuntu17.10) ...
Setting up mysql-client (5.7.20-1ubuntu17.10) ...
root@csdn:/usr/java#
root@csdn:/usr/java# dpkg -i libmecab2_0.996-1.1_amd64.deb
Selecting previously unselected package libmecab2.
(Reading database ... 102437 files and directories currently installed.)
Preparing to unpack libmecab2_0.996-1.1_amd64.deb ...
Unpacking libmecab2 (0.996-1.1) ...
Setting up libmecab2 (0.996-1.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@csdn:/usr/java#
再安装第四个包: root@csdn:/usr/java# dpkg -i mysql-community-server_5.7.20-1ubuntu17.10_amd64.deb
(Reading database ... 102445 files and directories currently installed.)
Preparing to unpack mysql-community-server_5.7.20-1ubuntu17.10_amd64.deb ...
.
Unpacking mysql-community-server (5.7.20-1ubuntu17.10) over (5.7.20-1ubuntu17.10) ...
Setting up mysql-community-server (5.7.20-1ubuntu17.10) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2) ...
root@csdn:/usr/java#
安装过程提示设置密码(输入两次一样的,为了确认):root@csdn:/usr/java# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
上面登录MySQL时的信息已经说明了(在此吐槽一下,网上有很对人问,有很多人说查询MySQL安装版本,你们记住了吗?登录MySQL时不是已经给你提示了什么版本了吗?)。
相关链接:
在 CentOS 1804 中 使用 yum 安装 MySQL 5.7 最新版
在 CentOS 1804 中 安装 MySQL 5.7.20 (或任意MySQL版本)
在 CentOS 1804 中 修改 MySQL 密码策略
在 CentOS 中 开启 MySQL 的 3306 端口
在不打开 MySQL 3306 端口的情况下,使用 Navicat 进项远程连接(使用22端口)
在 Ubuntu 中安装 MySQL5.7.20(任意版本)
在 Ubuntu 中安装 MySQL5.7.** 最新版
CentOS 6/7 安装 MySQL 8 最新版
CentOS 6/7 安装 MySQL 8.0.11 (或任意版)
MySQL 5.7 最新版 使用 yum 安装 MySQL NDB Cluster 7.5 最新版 集群
MySQL 集群 MySQL NDB Cluster 7.5.** 与 MySQL 5.7.** 对应版本说明
MySQL 集群 MySQL NDB Cluster 7.6.** 与 MySQL 5.7.** 对应版本说明
MySQL 5.7.20 (或指定版本) 与 MySQL NDB Cluster 7.6.4 (或指定版本) 集群
Windows 安装 MySQL 5.7.20 教程(及常见问题解决)
MySQL 5.7.20 (或任意版本) 的 Windows 版 安装程序 (msi) 下载