安装

先去下载 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安装以及使用的更多相关文章

  1. MySql-8.0.16版本部分安装问题修正

    本帖参考网站<https://blog.csdn.net/lx318/article/details/82686925>的安装步骤,并对8.0.16版本的部分安装问题进行修正 在MySQL ...

  2. Linux(CentOS7)下rpm安装MySQL8.0.16

    记录一下自己在 CentOS7 下 rpm 安装 MySQL8.0.16 的过程. 一.准备工作 1. 下载MySQL所需要的安装包 从 MySQL官网 下载,上传至 CentOS 系统 /usr/l ...

  3. centos7编译安装LNMP(nginx-1.16.0,mysql8.0.16,php-7.3.6)常见问题报错及解决方法

    LNMP的安装与配置 nginx-1.16.0安装及配置: 第一步:前往官网下载nignx源码包 下载完毕后上传至服务器(先安装lrzsz) yum -y install lrzsz 安装完毕后执行: ...

  4. Win10下免安装版MySQL8.0.16的安装和配置

    1.MySQL8.0.16解压 其中dada文件夹和my.ini配置文件是解压后手动加入的,如下图所示 2.新建配置文件my.ini放在D:\Free\mysql-8.0.16-winx64目录下 [ ...

  5. mysql8.0.16二进制安装

    mysql8.0.16二进制安装 环境简介操作系统:Centos 6.10 64位 目前版本:8.0.16 MySQL Community Server 二进制 安装目录:/data/mysql/my ...

  6. win10,64位操作系统安装mysql-8.0.16经验总结(图文详细,保证一次安装成功)

    文章目录 1.mysql下载 2.解压及配置文件 3.启动MySQL数据库 4.登录 MySQL 5.配置系统环境变量 6.mysql-8.0.16修改初始密码 机器配置: win10,64位: my ...

  7. MySQL-8.0.16 的安装与配置

    最近老是安装mysql, 但是由于各个环境下文件不互通,所以感觉笔记还是记录在这里比较方便.以下内容,是对网络上大家的笔记的搜集和整理,并经过自己的实践,记录下来.以便,让大家更好.更快的配置mysq ...

  8. Mysql8.0.16 only_full_group_by

    [1]Mysql8.0.16 关于only_full_group_by问题 应公司业务的需求,安装了Mysql8.0.16版本,原来在Mysql5.6版本执行无恙的SQL语句: SELECT prod ...

  9. mysql8.0.16操作记录

    mysql8.0.16操作记录 2.1.登录 -uroot -p'AnvcTMagdLarwNV3CKaC' mysql: [Warning] Using a password on the comm ...

随机推荐

  1. 学习:C++中的头文件和源文件详解

    一.C++编译模式: 通常,在一个C++程序中,只包含两类文件――.cpp文件和.h文件.其中,.cpp文件被称作C++源文件,里面放的都是C++的源代码:而.h文件则被称作C++头文件,里面放的也是 ...

  2. ICMP隧道

    参考文章:http://www.sohu.com/a/297393423_783648

  3. JavaScript基础06——Math对象和日期对象

    内置对象-Math:  Math对象用于执行 数学任务,Math 不像 Date 和 String 那样是对象的类,因此没有构造函数Math().无需创建,直接把Math当成对象使用,就可以调用其所有 ...

  4. eclipse 配置python环境 json 插件

    windows->install new software add 配置python 环境: name:pydev(可随意写) url:http://pydev.org/updates/ (如果 ...

  5. 2019.12.11 java练习

    class Demo01 { public static void main(String[] args) { //数组求最大值 int[] arr={1,2,3,4,5,6,7,8,9}; int ...

  6. C# VS 调试 动态加载的 DLL

    原文:https://www.cnblogs.com/DasonKwok/p/10510218.html 在这篇文章的底部,有提供示例的Demo,可以参考一下哦,拿来直接就可以运行. 说明: 编译类库 ...

  7. CF 768B

    CF 768B题意:In each operation Sam must remove any element x, such that x>1, from the list and inser ...

  8. 洛谷 P2983 [USACO10FEB]购买巧克力Chocolate Buying 题解

    P2983 [USACO10FEB]购买巧克力Chocolate Buying 题目描述 Bessie and the herd love chocolate so Farmer John is bu ...

  9. 【JZOJ6206】【20190610】二分图边染色

    题目 ​ 对一个二分图的边染色,满足有相同端点的边的颜色一定不同; ​ 设最优染色为\(C\) ,你的染色为\(X\),只需要满足$ X \le 2^ {\lceil log  C \rceil }$ ...

  10. 深度学习图像配准 Image Registration: From SIFT to Deep Learning

    Image Registration is a fundamental step in Computer Vision. In this article, we present OpenCV feat ...