mysql怎么升级版本
杨建荣,竞技世界数据库专家、dbaplus社群联合发起人,腾讯云TVP,Oracle ACE,《Oracle DBA工作笔记》和《MySQL DBA工作笔记》作者;现就职于竞技世界,擅长数据管理、数据...
2024.11.15需要将在Windows上的mysql-5.7.35升级为mysql-5.7.39,除了将数据导出后再导入新版本的升级方法,还可以使用mysql_upgrade方法直接升级版本,并且mysql数据较为复杂的情况下更为适用。
升级过程操作方法注意老的mysql的环境变量要修改
关闭应用关闭数据库老数据库信息
C:\Users\admin>d:D:\>cd mysql-5.7.35-winx64D:\mysql-5.7.35-winx64>cd binD:\mysql-5.7.35-winx64\bin>mysql -u root -pEnter password: **********Welcome to the MySQL monitor.Commands end with ; or \g.Your MySQL connection id is 1845Server version: 5.7.35 MySQL Community Server (GPL)Copyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql>mysql>解压新数据库软件并移动数据将新mysql软件解压到同一目录下拷贝my.ini和data文件夹要将my.ini中的相应内容进行修改,例如basedir,datadir
移除老的mysql服务管理员启动cmd,进入mysql的bin目录,注意先将mysql服务停止
C:\Windows\system32>d:D:\>cd mysql-5.7.35-winx64D:\mysql-5.7.35-winx64>cd binD:\mysql-5.7.35-winx64\bin>mysqld --remove MySQLFailed to remove the service because the service is runningStop the service and try againD:\mysql-5.7.35-winx64\bin>mysqld --remove MySQLService successfully removed.安装并启动新的mysql服务安装新的mysql服务
D:\mysql-5.7.35-winx64\bin>cd ../D:\mysql-5.7.35-winx64>cd ../D:\>cd mysql-5.7.39-winx64D:\mysql-5.7.39-winx64>cd binD:\mysql-5.7.39-winx64\bin>mysqld --install mysql5.7Service successfully installed.启动新的mysql服务
D:\mysql-5.7.39-winx64\bin>net start mysql5.7mysql5.7 服务正在启动 .mysql5.7 服务已经启动成功。更新mysql密码是使用老的mysql密码
D:\mysql-5.7.39-winx64\bin>mysql_upgrade -uroot -pEnter password: **********Checking if update is needed.Checking server version.Running queries to upgrade MySQL server.Checking system database.mysql.columns_priv OKmysql.dbOKmysql.engine_costOK。。。。。。。。。iplat.xs_user_extOKiplat.xs_user_groupOKiplat.xs_user_group_member OKsys.sys_config OKUpgrade process completed successfully.Checking if update is needed.进入新的mysql中检查D:\mysql-5.7.39-winx64\bin>mysql -u root -pEnter password: **********Welcome to the MySQL monitor.Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.39 MySQL Community Server (GPL)Copyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql>mysql>mysql> show databases;+--------------------+| Database|+--------------------+| information_schema || act|| mysql|| performance_schema || sys|+--------------------+9 rows in set (0.00 sec)5 rows in set (0.00 sec)杨建荣,竞技世界数据库专家、dbaplus社群联合发起人,腾讯云TVP,Oracle ACE,《Oracle DBA工作笔记》和《MySQL DBA工作笔记》作者;现就职于竞技世界,擅长数据管理、数据...
2024.11.15概述MySQL在5.5.3之后增加了这个utf8mb4的编码,mb4就是most bytes 4的意思,专门用来兼容四字节的unicode。好在utf8mb4是utf8的超集,除了将编码改为utf8m...
2024.11.15原文:https://www.enmotech.com/web/detail/1/838/1.html (复制链接,打开浏览器即可查看)北冥有 Data,其名为鲲,鲲之大,一个 MySQL 放不下。千...
2024.11.151、检查连接库信息等information_schema.PROCESSLISTselect SUBSTRING_INDEX(host,‘:‘,1) as ip , count(*) from inf...
2024.11.15概述今天主要介绍一个MySQL数据库版本号排序问题,一起来看看吧~需求按版本号排序,版本号字段为字符类型,其中1.2.10应大于1.2.9,但mysql数据库会认为1.2.9大于1.2.1正确的版本号...
2024.11.15