mysql8升级测试

参考文档:https://mysql.net.cn/doc/refman/8.0/en/mysql-upgrade.html

mysql5.7包: mysql-5.7.25-linux-glibc2.12-x86_64         <<<glibc2.12
mysql8包: mysql-8.0.35-linux-glibc2.28-x86_64.tar.xz    <<< glibc2.28 ,这个包,需要升级gcc,最终没有使用这个包
mysql8包:mysql-8.0.35-linux-glibc2.12-x86_64.tar.xz     <<< 最终使用这个包 
  

-- 创建mysql5.7的文件夹

[mysql@19ctest mysql]$ mkdir -p mysql_upgrade_test/mysql7000
[mysql@19ctest mysql]$ cd mysql_upgrade_test/mysql7000
[mysql@19ctest mysql_upgrade_test]$ pwd
/mysql/mysql_upgrade_test/mysql7000
[mysql@19ctest mysql_upgrade_test]$

--安装mysql5.7,copy安装文件到指定的目录

[mysql@19ctest mysql-5.7.25-linux-glibc2.12-x86_64]$ cp -r * /mysql/mysql_upgrade_test/mysql7000/
[mysql@19ctest mysql-5.7.25-linux-glibc2.12-x86_64]$

-- 编辑my7000.cnf文件

vi /mysql/mysql_upgrade_test/mysql7000/my7000.cnf
[mysqld]
datadir=/mysql/mysql_upgrade_test/mysql7000/data
socket=/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
port=7000
basedir=/mysql/mysql_upgrade_test/mysql7000
server-id=7000
lc-messages-dir=/mysql/mysql_upgrade_test/mysql7000/share/english
[client]
port=7000
socket=/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
[mysql]
prompt="\u@db \R:\m:\s [\d]> "

-- 进行初始化mysql5.7 .会生成初始化的密码 

cd /mysql/mysql_upgrade_test/mysql7000/bin
./mysqld  --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf  --initialize  --user=mysql [mysql@19ctest bin]$ ./mysqld  --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf  --initialize  --user=mysql
2023-12-16T00:59:37.088284Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-16T00:59:37.425015Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-12-16T00:59:37.488073Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-12-16T00:59:37.545716Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 6292a606-9bae-11ee-958f-000c290cfd81.
2023-12-16T00:59:37.548191Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-12-16T00:59:37.550658Z 1 [Note] A temporary password is generated for root@localhost: *eJr:Barb7cq
[mysql@19ctest bin]$

--启动mysql5.7 

./mysqld_safe --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf --user=mysql &   [mysql@19ctest bin]$ pwd
/mysql/mysql_upgrade_test/mysql7000/bin
[mysql@19ctest bin]$ ./mysqld_safe --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf --user=mysql &
[1] 4731
[mysql@19ctest bin]$ 2023-12-16T01:27:33.821921Z mysqld_safe Logging to '/mysql/mysql_upgrade_test/mysql7000/data/19ctest.err'.
2023-12-16T01:27:33.873417Z mysqld_safe Starting mysqld daemon with databases from /mysql/mysql_upgrade_test/mysql7000/data[mysql@19ctest bin]$

-- 登录MySQL5.7 ,修改密码 

[mysql@19ctest bin]$ ./mysql -uroot -hlocalhost -p*eJr:Barb7cq -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25Copyright (c) 2000, 2019, 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.root@db 09:36:11 [(none)]>
root@db 09:36:11 [(none)]> alter user 'root'@'localhost' identified by 'mysql';
Query OK, 0 rows affected (0.00 sec)root@db 09:38:46 [(none)]>[mysql@19ctest bin]$ ./mysql -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25 MySQL Community Server (GPL)Copyright (c) 2000, 2019, 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.root@db 09:39:12 [(none)]>

-- 解压mysql8 

[mysql@19ctest mysql_upgrade_test]$ tar -xvf mysql-8.0.35-linux-glibc2.12-x86_64.tar.xz
[mysql@19ctest mysql_upgrade_test]$ mv mysql-8.0.35-linux-glibc2.12-x86_64 mysql8000
[mysql@19ctest mysql_upgrade_test]$ ls -l
total 448912
drwxr-xr-x 10 mysql mysql      4096 Dec 16 09:42 mysql7000
drwxrwxr-x  9 mysql mysql       129 Dec 16 09:44 mysql8000
-rw-rw-r--  1 mysql mysql 459678820 Dec 16 09:42 mysql-8.0.35-linux-glibc2.12-x86_64.tar.xz
[mysql@19ctest mysql_upgrade_test]$

-- 编辑mysql8的cnf文件

[mysql@19ctest mysql8000]$ more my8000.cnf
[mysqld]
datadir=/mysql/mysql_upgrade_test/mysql7000/data
socket=/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
port=7000
basedir=/mysql/mysql_upgrade_test/mysql8000
server-id=7000
plugin_dir=/mysql/mysql_upgrade_test/mysql8000/lib/plugin
lc-messages-dir=/mysql/mysql_upgrade_test/mysql8000/share/english[client]
port=7000
socket=/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
[mysql]
prompt="\u@db \R:\m:\s [\d]> "[mysql@19ctest mysql8000]$

-- 进行升级,进入到MySQL8的目录,执行升级

[mysql@19ctest mysql_upgrade_test]$ cd mysql8000/
[mysql@19ctest mysql8000]$ cd bin
[mysql@19ctest bin]$./mysql_upgrade -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock

-- mysql8.0.16开始,升级变了。

[mysql@19ctest bin]$ ./mysql_upgrade -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock
The mysql_upgrade client is now deprecated. The actions executed by the upgrade client are now done by the server.
To upgrade, please start the new MySQL binary with the older data directory. Repairing user tables is done automatically. Restart is not required after upgrade.
The upgrade process automatically starts on running a new MySQL binary with an older data directory. To avoid accidental upgrades, please use the --upgrade=NONE option with the MySQL binary. The option --upgrade=FORCE is also provided to run the server upgrade sequence on demand.
It may be possible that the server upgrade fails due to a number of reasons. In that case, the upgrade sequence will run again during the next MySQL server start. If the server upgrade fails repeatedly, the server can be started with the --upgrade=MINIMAL option to start the server without executing the upgrade sequence, thus allowing users to manually rectify the problem.
[mysql@19ctest bin]$

-- 关闭mysql5.7,使用MySQL8启动数据库并升级

[mysql@19ctest bin]$ ./mysqladmin -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock shutdown
Enter password:
[mysql@19ctest bin]$

-- 启动mysql8 并升级

cd mysql/mysql_upgrade_test/mysql8000/bin
./mysqld --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf --user=mysql --upgrade=auto[mysql@19ctest bin]$ ./mysqld --defaults-file=/mysql/mysql_upgrade_test/mysql7000/my7000.cnf --user=mysql --upgrade=auto
mysqld: Can't open shared library '/mysql/mysql_upgrade_test/mysql7000/lib/plugin/component_reference_cache.so' (errno: 0 /mysql/mysql_upgrade_test/mysql7000/lib/plugin/component_reference_cache.so: cannot open shared object file: No such file or dir)
mysqld: Cannot load component from specified URN: 'file://component_reference_cache'.
2023-12-16T03:02:35.149213Z 0 [System] [MY-010116] [Server] /mysql/mysql_upgrade_test/mysql8000/bin/mysqld (mysqld 8.0.35) starting as process 13303
2023-12-16T03:02:35.167658Z 0 [ERROR] [MY-010340] [Server] Error message file '/mysql/mysql_upgrade_test/mysql7000/share/english/errmsg.sys' had only 1116 error messages, but it should contain at least 5862 error messages. Check that the above file is the right version for this program!
2023-12-16T03:02:35.191241Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2023-12-16T03:02:35.191338Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-12-16T03:02:36.816575Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-12-16T03:02:38.587220Z 2 [System] [MY-011003] [Server] Finished populating Data Dictionary tables with data.
2023-12-16T03:02:39.360123Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' started.
2023-12-16T03:02:43.514651Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' completed.
2023-12-16T03:02:43.777130Z 0 [Warning] [MY-013829] [Server] Missing data directory for ICU regular expressions: /mysql/mysql_upgrade_test/mysql7000/lib/private/.
2023-12-16T03:02:45.099229Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-12-16T03:02:45.099309Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-12-16T03:02:45.360171Z 0 [System] [MY-010931] [Server] /mysql/mysql_upgrade_test/mysql8000/bin/mysqld: ready for connections. Version: '8.0.35'  socket: '/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock'  port: 7000  MySQL Community Server - GPL.
2023-12-16T03:02:45.360272Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock

-- 问题1 ,找不到component_reference_cache.so,查看mysql5.7,里面没有这个文件,mysql8,有这个文件

[mysql@19ctest plugin]$ ls -l component_reference_cache.so
ls: cannot access component_reference_cache.so: No such file or directory
[mysql@19ctest plugin]$ pwd
/mysql/mysql_upgrade_test/mysql7000/lib/plugin
[mysql@19ctest plugin]$
[mysql@19ctest lib]$ cd plugin/
[mysql@19ctest plugin]$ ls -l component_reference_cache.so
-rwxr-xr-x 1 mysql mysql 89272 Oct 13 00:27 component_reference_cache.so
[mysql@19ctest plugin]$ pwd
/mysql/mysql_upgrade_test/mysql8000/lib/plugin
[mysql@19ctest plugin]$

解决方法:修改mysql8的cof文件,添加plugin_dir
plugin_dir=/mysql/mysql_upgrade_test/mysql8000/lib/plugin


--再次启动mysql 8,进行升级 

[mysql@19ctest bin]$ ./mysqld --defaults-file=/mysql/mysql_upgrade_test/mysql8000/my8000.cnf --user=mysql --upgrade=auto
2023-12-16T05:13:03.039494Z 0 [System] [MY-010116] [Server] /mysql/mysql_upgrade_test/mysql8000/bin/mysqld (mysqld 8.0.35) starting as process 4981
2023-12-16T05:13:03.041250Z 0 [Warning] [MY-010339] [Server] Using pre 5.5 semantics to load error messages from /mysql/mysql_upgrade_test/mysql8000/share/english/. If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2023-12-16T05:13:03.052260Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2023-12-16T05:13:03.052295Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-12-16T05:13:04.267690Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-12-16T05:13:05.266337Z 2 [System] [MY-011003] [Server] Finished populating Data Dictionary tables with data.
2023-12-16T05:13:05.866598Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' started.
2023-12-16T05:13:09.623950Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' completed.
2023-12-16T05:13:11.785012Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-12-16T05:13:11.785080Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-12-16T05:13:12.352943Z 0 [System] [MY-010931] [Server] /mysql/mysql_upgrade_test/mysql8000/bin/mysqld: ready for connections. Version: '8.0.35'  socket: '/mysql/mysql_upgrade_test/mysql7000/mysql7000.sock'  port: 7000  MySQL Community Server - GPL.
2023-12-16T05:13:12.353089Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock

-- 升级完成,登录MySQL8 .正常

./mysqladmin -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock shutdown 
./mysqld_safe --defaults-file=/mysql/mysql_upgrade_test/mysql8000/my8000.cnf --user=mysql &./mysql -uroot -hlocalhost -p -P7000 -S /mysql/mysql_upgrade_test/mysql7000/mysql7000.sock

END

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/227587.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

docker入门小结

docker是什么&#xff1f;它有什么优势&#xff1f; 快速获取开箱即用的程序 docker使得所有的应用传输就像我们日常通过聊天工具文件传输一样&#xff0c;发送方将程序传输到超级码头而接收方也只需通过超级码头进行获取即可&#xff0c;就像一只鲸鱼拖着货物来回运输一样。…

前端API请求缓存的5种方案

文章目录 一、前言二、[方案一]数据缓存三、[方案二]单promise 缓存四、[方案三]多promise 缓存五、[方案四]添加时间有关的缓存六、[方案五]基于修饰器的方案四七、最后 一、前言 开发 web 应用程序时&#xff0c;性能都是必不可少的话题。 对于webpack打包的单页面应用程序…

win中查看MD5、Linux中查看MD5

win中的MD5计算 1、用GitBash Git Bash Here md5sum.exe 我记得-孙燕姿.mp32、win自带命令 certutil -hashfile 我记得-孙燕姿.mp3 MD5Linux中MD5计算 md5sum 我记得-孙燕姿.mp3

离线编译安装opencv库及多版本切换[ubuntu]

系统版本&#xff1a;ubuntu18.04 库版本&#xff1a;opencv4.6.0 & opencv3.6.0 一、多版本安装前准备 1. 卸载已经安装的opencv版本[可选] 1.1 卸载从软件仓库中安装的opencv sudo apt-get purge libopencv* 1.2 卸载使用source自行编译安装的opencv 首先进入原先编译…

你好,C++(3)2.1 一个C++程序的自白

第2部分 与C第一次亲密接触 在浏览了C“三分天下”的世界版图之后&#xff0c;便对C有了基本的了解&#xff0c;算是一只脚跨入了C世界的大门。那么&#xff0c;怎样将我们的另外一只脚也跨入C世界的大门呢&#xff1f;是该即刻开始编写C程序&#xff1f;还是…… 正在我们犹…

springboot(ssm疗养院管理系统 养老院管理平台Java系统

springboot(ssm疗养院管理系统 养老院管理平台Java系统 开发语言&#xff1a;Java 框架&#xff1a;ssm/springboot vue JDK版本&#xff1a;JDK1.8&#xff08;或11&#xff09; 服务器&#xff1a;tomcat 数据库&#xff1a;mysql 5.7&#xff08;或8.0&#xff09; 数…

Event事件的整理

很久没去看thinkphp框架文档&#xff0c;结果看到有更新到8.0版本。 好奇去下载框架运行&#xff0c; 好在我电脑都有运行的PHP版本是8.1多&#xff0c;拿捏这个新出的think 今天摸索event的这个事件功能&#xff0c; 文档的介绍是这样&#xff1a; (省略几十字)&#xff0…

[实践总结] 典型的串行任务局部并行化处理案例:多任务并发获取航班信息

假设你有一个APP&#xff0c;主要用于查询航班信息&#xff0c;你的APP是没有这些实时数据的&#xff0c;当用户发起查询请求时&#xff0c;你需要到各大航空公司的接口获取信息&#xff0c;最后统一整理加工返回到APP客户端。当然JDK自带了很多高级工具&#xff0c;比如CountD…

【Qt】报错error:undefined reference to `vtable for Consumer‘的解决方法

1. 问题原因 在创建完程序后&#xff0c;点击构建&#xff0c;显示编译错误。 错误问题如下: error: undefined reference to vtable在编译输出中查看显示如下&#xff1a; error:undefined reference to vtable for custom2. 原因分析 这个错误通常是因为 C 的虚函数表&am…

《面向机器学习的数据标注规程》摘录

说明&#xff1a;本文使用的标准是2019年的团体标准&#xff0c;最新的国家标准已在2023年发布。 3 术语和定义 3.2 标签 label 标识数据的特征、类别和属性等。 3.4 数据标注员 data labeler 对待标注数据进行整理、纠错、标记和批注等操作的工作人员。 【批注】按照定义…

Java中的网络通信协议与通信模型分析

一、引言 网络通信在现代社会中扮演着重要的角色&#xff0c;而Java作为一种广泛应用于网络编程的编程语言&#xff0c;其网络通信协议与通信模型的分析显得尤为重要。本文将分析Java中常用的网络通信协议和通信模型&#xff0c;探讨其特点和应用场景。 二、网络通信协议 1. …

【已解决】ModuleNotFoundError: No module named ‘tensorflow‘

问题描述 Traceback (most recent call last): File "dataset_tool.py", line 16, in <module> import tensorflow as tf ModuleNotFoundError: No module named tensorflow 如果直接pip install tensorflow&#xff0c;还会报错 解决办法 方法一 pip i…

redis未授权漏洞复现

什么是redis redis就是个数据库&#xff0c;跟mysql不同的地方在于redis主要将数据存在内存中&#xff0c;读写速度非常快 redis未授权 其原因很简单&#xff0c;就是redis服务器在默认安装好不配置的情况下可以直接免密码登录&#xff0c;登录后在web目录写入一句话木马&am…

钉钉中预览打印PDF问题(无法使用blob地址)

使用pdfjs-dist预览文件 依赖 npm install pdfjs-dist2.14.305组件 <template><div id"pageContainer"><div id"viewer"></div></div> </template><script> import pdfjs-dist/web/pdf_viewer.css; import *…

前端设计模式之旅:命令模式

引言 使用命令模式&#xff0c;我们可以将执行特定任务的对象与调用该方法的对象解耦。 核心思想 命令模式的核心思想是将请求封装成一个对象&#xff0c;从而使请求的发起者和请求的执行者解耦。 请求的发起者只需要知道如何创建命令对象并将其传递给请求者&#xff0c;而不需…

极坐标下的牛拉法潮流计算57节点MATLAB程序

微❤关注“电气仔推送”获得资料&#xff08;专享优惠&#xff09; 潮流计算&#xff1a; 潮流计算是根据给定的电网结构、参数和发电机、负荷等元件的运行条件&#xff0c;确定电力系统各部分稳态运行状态参数的计算。通常给定的运行条件有系统中各电源和负荷点的功率、枢纽…

贪心算法:买卖股票的最佳时机II 跳跃游戏 跳跃游戏II

122.买卖股票的最佳时机II 思路&#xff1a; 想要获得利润&#xff0c;至少要以两天为一个交易单元&#xff0c;因为两天才会有股价差。因此可以将最终利润进行分解&#xff0c;如prices[3] - prices[0] (prices[3] - prices[2]) (prices[2] - prices[1]) (prices[1] - pr…

【Mars3d-ModelEntity】实现gltf模型不随地图缩放而改变大小

需求场景&#xff1a; 1.实现gltf模型不随地图缩放而改变大小 相关代码&#xff1a; const graphic new mars3d.graphic.ModelEntity({ name: "警车", position: [116.346929, 30.861947, 401.34], style: { url: "//data.mars3d.cn/gltf/mars/jingche/jingc…

python界面开发,使用wxpython库

入门学习Python时&#xff0c;使从接触一个项目开始&#xff0c;当时需要我开发一个界面&#xff0c;当时综合考量之后&#xff0c;最终选择了今天要分享的内容部分&#xff0c;也就是使用Python来开发&#xff0c;主要使用到的是Python库——wxPython库来进行界面开发&#xf…

Git批量删除本地分支

开发一段时间后&#xff0c;我们本地会有很多无用的分支&#xff0c;一个一个的 git branch -D branchName 又感觉太费时间了&#xff0c;如果要批量删除&#xff0c;可以用下面的命令&#xff1a; git checkout master git branch | grep -v master | xargs git branch -D 注…