MySQL8.0.16 单机 Linux安装以及使用
安装
先去下载 https://dev.mysql.com/downloads/mysql/

然后上传到Linux
进入存放目录,解压到指定目录【我这里是/soft/mysql8】
[root@localhost ~]# cd /soft/
[root@localhost soft]# mkdir mysql8
[root@localhost soft]# tar -xvf mysql-8.0.-.el7.x86_64.rpm-bundle.tar -C mysql8/
mysql-community-libs-8.0.-.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.-.el7.x86_64.rpm
mysql-community-devel-8.0.-.el7.x86_64.rpm
mysql-community-server-8.0.-.el7.x86_64.rpm
mysql-community-libs-compat-8.0.-.el7.x86_64.rpm
mysql-community-client-8.0.-.el7.x86_64.rpm
mysql-community-common-8.0.-.el7.x86_64.rpm
mysql-community-test-8.0.-.el7.x86_64.rpm
进入解压后的目录,安装
[root@localhost soft]# cd mysql8/
[root@localhost mysql8]# yum install mysql-community-{server,client,common,libs}-*
Loaded plugins: fastestmirror, langpacks
Examining mysql-community-server-8.0.-.el7.x86_64.rpm: mysql-community-server-8.0.-.el7.x86_64
Marking mysql-community-server-8.0.-.el7.x86_64.rpm to be installed
Examining mysql-community-client-8.0.-.el7.x86_64.rpm: mysql-community-client-8.0.-.el7.x86_64
Marking mysql-community-client-8.0.-.el7.x86_64.rpm to be installed
Examining mysql-community-common-8.0.-.el7.x86_64.rpm: mysql-community-common-8.0.-.el7.x86_64
Marking mysql-community-common-8.0.-.el7.x86_64.rpm to be installed
Examining mysql-community-libs-8.0.-.el7.x86_64.rpm: mysql-community-libs-8.0.-.el7.x86_64
Marking mysql-community-libs-8.0.-.el7.x86_64.rpm to be installed
Examining mysql-community-libs-compat-8.0.-.el7.x86_64.rpm: mysql-community-libs-compat-8.0.-.el7.x86_64
Marking mysql-community-libs-compat-8.0.-.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mariadb-libs.x86_64 :5.5.-.el7_5 will be obsoleted
---> Package mysql-community-client.x86_64 :8.0.-.el7 will be installed
---> Package mysql-community-common.x86_64 :8.0.-.el7 will be installed
---> Package mysql-community-libs.x86_64 :8.0.-.el7 will be obsoleting
---> Package mysql-community-libs-compat.x86_64 :8.0.-.el7 will be obsoleting
---> Package mysql-community-server.x86_64 :8.0.-.el7 will be installed
--> Finished Dependency Resolution
base//x86_64 | 3.6 kB ::
extras//x86_64 | 3.4 kB ::
updates//x86_64 | 3.4 kB :: Dependencies Resolved =================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================================
Installing:
mysql-community-client x86_64 8.0.-.el7 /mysql-community-client-8.0.-.el7.x86_64 M
mysql-community-common x86_64 8.0.-.el7 /mysql-community-common-8.0.-.el7.x86_64 8.0 M
mysql-community-libs x86_64 8.0.-.el7 /mysql-community-libs-8.0.-.el7.x86_64 M
replacing mariadb-libs.x86_64 :5.5.-.el7_5
mysql-community-libs-compat x86_64 8.0.-.el7 /mysql-community-libs-compat-8.0.-.el7.x86_64 9.5 M
replacing mariadb-libs.x86_64 :5.5.-.el7_5
mysql-community-server x86_64 8.0.-.el7 /mysql-community-server-8.0.-.el7.x86_64 1.8 G Transaction Summary
=================================================================================================================================================================================================================================================
Install Packages Total size: 1.9 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-common-8.0.-.el7.x86_64 /
Installing : mysql-community-libs-8.0.-.el7.x86_64 /
Installing : mysql-community-client-8.0.-.el7.x86_64 /
Installing : mysql-community-server-8.0.-.el7.x86_64 /
Installing : mysql-community-libs-compat-8.0.-.el7.x86_64 /
Erasing : :mariadb-libs-5.5.-.el7_5.x86_64 /
Verifying : mysql-community-libs-8.0.-.el7.x86_64 /
Verifying : mysql-community-libs-compat-8.0.-.el7.x86_64 /
Verifying : mysql-community-client-8.0.-.el7.x86_64 /
Verifying : mysql-community-common-8.0.-.el7.x86_64 /
Verifying : mysql-community-server-8.0.-.el7.x86_64 /
Verifying : :mariadb-libs-5.5.-.el7_5.x86_64 / Installed:
mysql-community-client.x86_64 :8.0.-.el7 mysql-community-common.x86_64 :8.0.-.el7 mysql-community-libs.x86_64 :8.0.-.el7 mysql-community-libs-compat.x86_64 :8.0.-.el7 mysql-community-server.x86_64 :8.0.-.el7 Replaced:
mariadb-libs.x86_64 :5.5.-.el7_5 Complete!
到此就安装结束,下面开启防火墙端口3306并启动。开启防火墙端口是希望外界可以访问。
[root@localhost mysql8]# firewall-cmd --zone=public --add-port=/tcp --permanent
success
[root@localhost mysql8]# systemctl restart firewalld
[root@localhost mysql8]# systemctl start mysqld
[root@localhost mysql8]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri -- :: CST; 5s ago
Docs: man:mysqld()
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=/SUCCESS)
Main PID: (mysqld)
Status: "SERVER_OPERATING"
Tasks:
CGroup: /system.slice/mysqld.service
└─ /usr/sbin/mysqld May :: localhost.localdomain systemd[]: Starting MySQL Server...
May :: localhost.localdomain systemd[]: Started MySQL Server.
下面因为第一次启动,需要修改密码。
[root@localhost mysql8]# cat /var/log/mysqld.log | grep password
--23T21::.393815Z [Note] [MY-] [Server] A temporary password is generated for root@localhost: U3ZlzC>KAAc<
[root@localhost mysql8]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. Copyright (c) , , 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> ALTER USER USER() IDENTIFIED BY 'Abc123-S';
Query OK, rows affected (0.02 sec)
到此安装以及初始化完毕,你可以在此执行一些SQL语句。
用Navicat连接
你要创建一个新用户并授权。
mysql> CREATE USER 'tom'@'%' IDENTIFIED BY 'Abc123-S';
Query OK, rows affected (0.02 sec) mysql> GRANT ALL ON *.* TO 'tom'@'%';
Query OK, rows affected (0.02 sec)
连接的时候会出现

这是因为不支持当前的加密协议。MySQL8 创建用户默认使用caching_sha2_password,所以我们可以更改为MySQL5.7的mysql_native_password。
mysql> ALTER USER 'tom'@'%' IDENTIFIED WITH mysql_native_password BY 'Abc123-S';
Query OK, rows affected (0.00 sec)
好了这次可以了

MySQL8.0.16 单机 Linux安装以及使用的更多相关文章
- MySql-8.0.16版本部分安装问题修正
本帖参考网站<https://blog.csdn.net/lx318/article/details/82686925>的安装步骤,并对8.0.16版本的部分安装问题进行修正 在MySQL ...
- Linux(CentOS7)下rpm安装MySQL8.0.16
记录一下自己在 CentOS7 下 rpm 安装 MySQL8.0.16 的过程. 一.准备工作 1. 下载MySQL所需要的安装包 从 MySQL官网 下载,上传至 CentOS 系统 /usr/l ...
- centos7编译安装LNMP(nginx-1.16.0,mysql8.0.16,php-7.3.6)常见问题报错及解决方法
LNMP的安装与配置 nginx-1.16.0安装及配置: 第一步:前往官网下载nignx源码包 下载完毕后上传至服务器(先安装lrzsz) yum -y install lrzsz 安装完毕后执行: ...
- Win10下免安装版MySQL8.0.16的安装和配置
1.MySQL8.0.16解压 其中dada文件夹和my.ini配置文件是解压后手动加入的,如下图所示 2.新建配置文件my.ini放在D:\Free\mysql-8.0.16-winx64目录下 [ ...
- mysql8.0.16二进制安装
mysql8.0.16二进制安装 环境简介操作系统:Centos 6.10 64位 目前版本:8.0.16 MySQL Community Server 二进制 安装目录:/data/mysql/my ...
- win10,64位操作系统安装mysql-8.0.16经验总结(图文详细,保证一次安装成功)
文章目录 1.mysql下载 2.解压及配置文件 3.启动MySQL数据库 4.登录 MySQL 5.配置系统环境变量 6.mysql-8.0.16修改初始密码 机器配置: win10,64位: my ...
- MySQL-8.0.16 的安装与配置
最近老是安装mysql, 但是由于各个环境下文件不互通,所以感觉笔记还是记录在这里比较方便.以下内容,是对网络上大家的笔记的搜集和整理,并经过自己的实践,记录下来.以便,让大家更好.更快的配置mysq ...
- Mysql8.0.16 only_full_group_by
[1]Mysql8.0.16 关于only_full_group_by问题 应公司业务的需求,安装了Mysql8.0.16版本,原来在Mysql5.6版本执行无恙的SQL语句: SELECT prod ...
- mysql8.0.16操作记录
mysql8.0.16操作记录 2.1.登录 -uroot -p'AnvcTMagdLarwNV3CKaC' mysql: [Warning] Using a password on the comm ...
随机推荐
- 11 open source business models
https://www.zdnet.com/article/11-open-source-business-models/ Critics are always claiming open sourc ...
- Linux下搭建iSCSI共享存储的方法 Linux-IO Target 方式CentOS7-1810下实现
iSCSI(internet SCSI)技术由IBM公司研究开发,是一个供硬件设备使用的.可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议,使其能够在诸如高速 ...
- Codevs 3322 时空跳跃者的困境(组合数 二项式定理)
3322 时空跳跃者的困境 时间限制: 1 s 空间限制: 64000 KB 题目等级 : 钻石 Diamond 题目描述 Description 背景:收集完能量的圣殿战士suntian开始了他的追 ...
- 洛谷 P3385 【模板】负环 题解
P3385 [模板]负环 题目描述 暴力枚举/SPFA/Bellman-ford/奇怪的贪心/超神搜索 寻找一个从顶点1所能到达的负环,负环定义为:一个边权之和为负的环. 输入格式 第一行一个正整数T ...
- 时间datetime模块
datetime模块 import datetime --时间加减的模块 #返回当前时间 print(datetime.datetime.now()) --2019-09-28 17:22:14.54 ...
- 获取页面scroll高度
记录一下获取 scroll 高度的方法 经实际测试: document.body.scrollTop 在 chrome 下会返回0. 所以 document.documentElement.scrol ...
- Spyder汉化问题
首先感谢李增海大神,以下内容来源于http://www.lizenghai.com 必备条件 1.已安装Spyder 2.Spyder版本在3.X以上 Spyder安装: 1.anaconda下,co ...
- PCA与ICA
关于机器学习理论方面的研究,最好阅读英文原版的学术论文.PCA主要作用是数据降维,而ICA主要作用是盲信号分离.在讲述理论依据之前,先思考以下几个问题:真实的数据训练总是存在以下几个问题: ①特征冗余 ...
- leetcode 删除一张表中重复邮箱的数据,并且保留最小id 的 那条
/* create view testview as SELECT subject,MIN(Id) as id FROM test GROUP BY subject; select * FROM te ...
- 微信小程序 报错Failed to load image
加载网络图片WXML代码: <image class="userinfo-avatar" src="{{avatarUrl}}"></imag ...