当前MySQL版本为:5.7.21

升级前准备,了解5.7和8.0版本有何区别,本文主要为升级操作文档,具体建议参考官方文档,概括性的有以下几点:

》默认字符集由latin1变为utf8mb4

》支持隐藏索引,索引可以被隐藏和显示

》用户创建,修改和授权

》sql_mode参数默认值变化

》支持窗口函数等

》sql_mode参数默认值变化

以下为升级8.0需要配置文件中新增的参数配置

#for8.0
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
character-set-server = utf8mb4
collation_server = utf8mb4_general_ci
basedir = /home/mysql8
skip_ssl
default_authentication_plugin=mysql_native_password

环境说明:我是本机部署了两个mysql 实例,分别为3306和3307,3306为主节点

首先升级实例3307 (从库)

[root@localhost mysql]# ./bin/mysql -uroot -p -S /home/mysql/3307/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21-log MySQL Community Server (GPL) 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> show variables like 'innodb_fast_shutdown';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_fast_shutdown | 1 |
+----------------------+-------+
1 row in set (0.01 sec) mysql> set global innodb_fast_shutdown=0;
Query OK, 0 rows affected (0.00 sec)
mysql> shutdown;
mysql> exit
Bye
[root@localhost mysql8]# cd /home/mysql8
[root@localhost mysql8]# ./bin/mysqld_safe --defaults-file=/home/mysql/3307/my.cnf &

登录重新查看版本以及主从情况和数据

[root@localhost mysql]# ./bin/mysql -uroot -p -S /home/mysql/3307/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.30 MySQL Community Server - GPL 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> select version();
+-----------+
| version() |
+-----------+
| 8.0.30 |
+-----------+
1 row in set (0.01 sec) mysql> start slave;
Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for source to send event
Master_Host: 192.168.53.123
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000007
Read_Master_Log_Pos: 154
Relay_Log_File: relay-log.000011
Relay_Log_Pos: 370
Relay_Master_Log_File: mysql-bin.000007
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
... ...

升级完成,3306实例主库操作同上

升级过程错误汇总:

1、启动失败,提示信息如下

经对 msyqld_safe 启动文件查看发现变量MY_PWD=`pwd`,执行启动得时候不能使用绝对路径,此变量需要获取当前路径,先进入mysql8 目录下执行./msyqld_safe --defaults-file="配置文件" 及恢复正常

如下信息说明现在启动后得配置文件使用得即为指定得配置文件

2、启动报错,日志如下图,此报错说设置utf8_general_ci设置utf8mb4,修改配置文件

3、启动报错,根据日志错误提示mysql5.7.21不支持innodb_dast_shutdown = 2 得时候升级

mysql版本升级 5.7.21-8.0.30的更多相关文章

  1. MySQL性能优化的21个最佳实践

    http://www.searchdatabase.com.cn/showcontent_38045.htm MySQL性能优化的21个最佳实践 1. 为查询缓存优化你的查询 大多数的MySQL服务器 ...

  2. [实战]MVC5+EF6+MySql企业网盘实战(21)——网盘操作日志

    写在前面 上篇文章介绍了一个bootstrap的分页插件,这篇将弄一个完整的例子,就以日志分页为例说明如何请求服务端然后进行分页. 系列文章 [EF]vs15+ef6+mysql code first ...

  3. MySQL中文全文索引插件 mysqlcft 1.0.0 安装使用文档[原创]

    [文章+程序 作者:张宴 本文版本:v1.0 最后修改:2008.07.01 转载请注明原文链接:http://blog.zyan.cc/post/356/] MySQL在高并发连接.数据库记录数较多 ...

  4. centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展

    .安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...

  5. win10环境下MySql(5.7.21版本)安装过程

    windows10上安装mysql(详细步骤) 2016年09月06日 08:09:34 阅读数:60405 环境:windwos 10(1511) 64bit.mysql 5.7.14 时间:201 ...

  6. for( unsigned int i=heapSize/2-1; i>=0; --i)

    unsigned int的表示 今天在写堆排序的时候遇到一个BUG void builMaxHeap( int *arr,unsigned int heapSize){ unsigned int i; ...

  7. Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/classes/struts.xml:11:71

    Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/ ...

  8. MySQL SQL审核平台 inception+archer2.0(亲测)

    docker run -d --privileged -v `pwd`/archer_data:/data -p 9306:3306 --name archer --hostname archer - ...

  9. NVIDIA-docker报错:docker-ce (= 5:18.09.0~3-0~ubuntu-xenial) but 18.06.0~ce~3-0~ubuntu is to be installed

    报错: The following packages have unmet dependencies: nvidia-docker2 : Depends: docker-ce (= 5:18.09.0 ...

  10. ubuntu中mysql版本升级到5.7

    0 前言 前几天图书馆说服务器(Ubuntu14.04)有安全漏洞,不按时修复会关停. 看了一下漏洞清单,主要是ssh和mysql的版本问题. 把mysql升级了一下,升到了5.7,升级之前还备份了数 ...

随机推荐

  1. python 之定时任务(schedule)

    import schedule import time def job(): print("定时通报...") # 定义一个叫job的函数,函数的功能是打印'定时通报...' sc ...

  2. 深度学习之Transformer网络

    [博主使用的python版本:3.6.8] 本次没有额外的资料下载 Packages ort tensorflow as tf import pandas as pd import time impo ...

  3. [深度学习] ncnn编译使用

    文章目录 工程 ncnn工程编译使用(cpu) ncnn工程编译使用(vulkan) 参考 工程 ncnn工程编译使用(cpu) 在linux下建立如CMakeLists文件即可编译生成ncnn工程 ...

  4. 加速 Document AI (文档智能) 发展

    在企业的数字工作流中充满了各种文档,包括信件.发票.表格.报告.收据等,我们无法自动提取它们的知识.如今随着文本.视觉和多模态人工智能的进步,我们有可能解锁这些知识,这篇文章向你展示了你的团队该如何使 ...

  5. flutter 设置Appbar上面的电池显示的状态栏的背景与颜色

    写代码,修改了一下Appbar后,发现这个顶部颜色不对劲 找到这个文件lib\main.dart import 'dart:io'; import 'package:flutter/services. ...

  6. Google Cloud Spanner 究竟是什么?

    谷歌于2017年推出的Google Cloud Spanner,原是谷歌内部使用的一个数据服务,后来又成为了谷歌云平台上搭建的数据库服务. Google Cloud Spanner 是一种数据库,它结 ...

  7. 记一下Go类型转换问题

    数值类型间可以相互转换 int<->int64,uint8<->float32,uint64<->float64 字符类型转换也可以 string<-> ...

  8. Python读取大量Excel文件并跨文件批量计算平均值

      本文介绍基于Python语言,实现对多个不同Excel文件进行数据读取与平均值计算的方法.   首先,让我们来看一下具体需求:目前有一个文件夹,其中存放了大量Excel文件:文件名称是每一位同学的 ...

  9. 找了几个 Solon 的商业落地项目案例!

    Solon 是啥?是一个高效的 Java 应用开发框架:更快.更小.更简单.(代码仓库:https://gitee.com/noear/solon) 提倡: 克制.简洁.开放.生态 启动快 5 - 1 ...

  10. Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation

    1.出现问题 查询数据时报如题错误 2.解决方案 建表时需指定字符集,例如: -- ---------------------------- -- Table structure for testTa ...