mysql版本升级 5.7.21-8.0.30
当前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的更多相关文章
- MySQL性能优化的21个最佳实践
http://www.searchdatabase.com.cn/showcontent_38045.htm MySQL性能优化的21个最佳实践 1. 为查询缓存优化你的查询 大多数的MySQL服务器 ...
- [实战]MVC5+EF6+MySql企业网盘实战(21)——网盘操作日志
写在前面 上篇文章介绍了一个bootstrap的分页插件,这篇将弄一个完整的例子,就以日志分页为例说明如何请求服务端然后进行分页. 系列文章 [EF]vs15+ef6+mysql code first ...
- MySQL中文全文索引插件 mysqlcft 1.0.0 安装使用文档[原创]
[文章+程序 作者:张宴 本文版本:v1.0 最后修改:2008.07.01 转载请注明原文链接:http://blog.zyan.cc/post/356/] MySQL在高并发连接.数据库记录数较多 ...
- centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展
.安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...
- win10环境下MySql(5.7.21版本)安装过程
windows10上安装mysql(详细步骤) 2016年09月06日 08:09:34 阅读数:60405 环境:windwos 10(1511) 64bit.mysql 5.7.14 时间:201 ...
- for( unsigned int i=heapSize/2-1; i>=0; --i)
unsigned int的表示 今天在写堆排序的时候遇到一个BUG void builMaxHeap( int *arr,unsigned int heapSize){ unsigned int i; ...
- 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/ ...
- MySQL SQL审核平台 inception+archer2.0(亲测)
docker run -d --privileged -v `pwd`/archer_data:/data -p 9306:3306 --name archer --hostname archer - ...
- 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 ...
- ubuntu中mysql版本升级到5.7
0 前言 前几天图书馆说服务器(Ubuntu14.04)有安全漏洞,不按时修复会关停. 看了一下漏洞清单,主要是ssh和mysql的版本问题. 把mysql升级了一下,升到了5.7,升级之前还备份了数 ...
随机推荐
- nuxt.js安装使用
首先要学会看文档,https://www.nuxtjs.cn/guide/configuration 一.创建项目,并运行 终端运行 npx create-nuxt-app <项目名> ( ...
- react 高效高质量搭建后台系统 系列 —— 脚手架搭建
其他章节请看: react 高效高质量搭建后台系统 系列 脚手架搭建 本篇主要创建新项目 myspug,以及准备好环境(例如:安装 spug 中用到的包.本地开发和部署.自定义配置 react-app ...
- 1、mybatis逆向工程
mybatis逆向工程可以针对单表自动生成mybatis执行所需要的mapper.java.mapper.xml代码(dao层),可以让程序员将更多的精力放在繁杂的业务逻辑上(service层与con ...
- Vue3 企业级优雅实战 - 组件库框架 - 9 实现组件库 cli - 上
上文搭建了组件库 cli 的基础架子,实现了创建组件时的用户交互,但遗留了 cli/src/command/create-component.ts 中的 createNewComponent 函数,该 ...
- 【转载】EXCEL VBA 自动筛选—AutoFilter方法
AutoFilter方法的语法及说明 下面是Range对象的AutoFilter方法的语法: Range对象.AutoFilter(Field,Criterial1,Operator,C ...
- java8新特性学习笔记
目录 1.速度更快 2.Lambda表达式 2.1.匿名内部类的Lambda转换 2.2.java8内置的四大核心函数式接口 2.3.方法引用和构造器 2.3.1.方法引用 2.3.2.构造器引用 2 ...
- C++string与int的相互转换(使用C++11)
一.int转string #include <iostream> #include <string> int main() { double f = 23.43; double ...
- 2023牛客寒假算法基础集训营1 ACDEFGHKLM
比赛链接 A 题解 知识点:模拟. 显然. (用char输入到一半直接给答案跳出,WA了两小时,无话可说. 时间复杂度 \(O(1)\) 空间复杂度 \(O(1)\) 代码 #include < ...
- python连接kafka-2.0
import sysimport timeimport osimport jsonimport vertica_pythonimport loggingimport pykafkafrom pykaf ...
- 第 1 天|基于 AI 进行游戏开发:5 天创建一个农场游戏!
欢迎使用 AI 进行游戏开发! 在本系列中,我们将使用各种 AI 工具,在 5 天内创建一个功能完备的农场游戏.到本系列结束时,你将了解到如何将多种 AI 工具整合到游戏开发流程中.本系列文章将向你展 ...