安装

先去下载 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. 36氪新风向 | 三个月估值普涨三倍,你未来的RPA机器人同事正在路上

    http://www.sohu.com/a/320208242_114778 2019 年 4 月,关注 RPA 赛道的投资人 Kevin(化名)就发现,仅仅过了一个春节,自己所在的早期基金已经投不起 ...

  2. Vue --- 组件练习

    一 ad_data = { tv: [ {img: 'img/tv/001.png', title: 'tv1'}, {img: 'img/tv/002.png', title: 'tv2'}, {i ...

  3. sort()函数中的key

    d = { , , } #for k in d.items(): # print(k) content = list(d.items()) print(content) content.sort(ke ...

  4. LeetCode 743. Network Delay Time

    原题链接在这里:https://leetcode.com/problems/network-delay-time/ 题目: There are N network nodes, labelled 1  ...

  5. pgloader 学习(六) 加载csv 数据

    关于加载的配置参数都是使用comand file command file 参考格式 LOAD CSV FROM 'GeoLiteCity-Blocks.csv' WITH ENCODING iso- ...

  6. 在AD中设置漫游配置文件与文件夹重定向

    在域环境下,域用户可以在域中的任意一台客户端计算机上登录,由于普通域用户的权限比较低,在大多数情况下只能对自己的用户配置文件具有完全控制权限,因而大多数域用户都是将数据直接保存在用户配置文件中.用户配 ...

  7. JavaScript中字符串多行编辑

    常用写法: var str = 'w3c' +'标准' +'方式.' 升级版:var str = ['w3c','标准','方式.'].join('');终极版:var str = 'w3c\标准\方 ...

  8. 在Matlab中画图输出

    在Matlab中画图后,可能会调整格式.输出存储时,格式会忽然消失. 可以修改右下边Export setup,将Font size设置成auto. 这样就保留了编辑效果.

  9. Python调用win32 API绘制正弦波

    Python调用win32 API新建窗口与直接创建窗口的流程相同 流程:注册窗口→创建窗口→显示窗口→更新窗口→消息循环 代码: # -*- coding: utf-8 -*- import win ...

  10. 京津冀大学生竞赛:babyphp

    京津冀大学生竞赛:babyphp 比赛的时候没做出来,回来以后一会就做出来了,难受...还是基本功不扎实,都不记得__invoke怎么触发的了 放上源码 <?php error_reportin ...