CentOS 6/7 安装 MySQL 8 最新版

相关链接:

在 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 (或指定版本) 集群


  1. 检查是否安装了wget:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# wget -V

    如果没有安装wget,执行下列命令安装:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# yum -y install wget
  2. 下载MySQL 8 rmp源:
    MySQL rpm源:http://repo.mysql.com/
    MySQL 8 适用于 CentOS 6 rpm源:http://repo.mysql.com/mysql80-community-release-el6.rpm
    MySQL 8 适用于 CentOS 7 rpm源:http://repo.mysql.com/mysql80-community-release-el7.rpm
    本文以 CentOS 7 为例安装 MySQL 8:
    下载 MySQL 8 rpm源:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# wget http://repo.mysql.com/mysql80-community-release-el7.rpm
    默认下载位置为用户当前所在位置。
     
  3. 安装 MySQL 8 rpm源:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# yum -y localinstall mysql80-community-release-el7.rpm
  4. 安装 MySQL 8 数据库:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# yum -y install mysql-community-server
  5. 启动MySQL数据库:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl start mysqld
  6. 开启MySQL的开机自启:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl enable mysqld
  7. 重新载入:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl daemon-reload
  8. 查看MySQL预设密码:
    使用命令(优先选择):
    [root@CSDNBlogs doc]# grep 'temporary password' /var/log/mysqld.log
    2018-10-19T16:43:18.727456Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ZWHc%Wg7a!s6
    或者使用:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# less /var/log/mysqld.log
    预设密码在root@localhost后面:
    2018-10-19T16:43:17.265505Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.12) initializing of server in progress as process 2745
    2018-10-19T16:43:18.727456Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ZWHc%Wg7a!s6
    2018-10-19T16:43:19.892087Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.12) initializing of server has completed
    2018-10-19T16:43:22.241433Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.12) starting as process 2794
    2018-10-19T16:43:26.751129Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
    2018-10-19T16:43:26.893648Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.12'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.
    
  9. 登录MySQL数据库(密码在上一步可查看):
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# mysql -u root -p 
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 9
    Server version: 8.0.12
    
    Copyright (c) 2000, 2018, 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> 
    
  10. 初次登录,修改数据库密码:
    mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Aaa+Bbb-123';
    Query OK, 0 rows affected (0.02 sec)
    

相关链接:

在 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 (或指定版本) 集群

猜你喜欢

转载自blog.csdn.net/qq_32596527/article/details/83189908