mysql 升级方法
Performing an In-place Upgrade
This section describes how to perform an in-place upgrade. Review Before you Begin before proceeding.
If you upgrade an installation originally produced by installing multiple RPM packages, upgrade all the packages, not just some. For example, if you previously installed the server and client RPMs, do not upgrade just the server RPM.
To perform an in-place upgrade:
Review the changes described in Section 2.11.1.1, “Changes Affecting Upgrades to MySQL 5.7” for steps to be performed before upgrading.
Configure MySQL to perform a slow shutdown by setting
innodb_fast_shutdownto0. For example:shell>
bin/mysql -u root -ppassword--execute="set global innodb_fast_shutdown=0"With a slow shutdown,
InnoDBperforms a full purge and change buffer merge before shutting down, which ensures that data files are fully prepared in case of file format differences between releases.Shut down the old MySQL server. For example:
shell>
bin/mysqladmin -u root -ppasswordshutdownUpgrade the MySQL binaries or packages in place, replacing the old binaries or packages with the new ones.
NoteFor supported Linux distributions, the preferred method for replacing the MySQL packages is to use the MySQL software repositories; see Section 2.11.1.2, “Upgrading MySQL with the MySQL Yum Repository”, Section 2.11.1.3, “Upgrading MySQL with the MySQL APT Repository”, or Upgrading MySQL with the MySQL SLES Repository for instructions.
Start the MySQL 5.7 server, using the existing data directory. For example:
shell>
bin/mysqld_safe --user=mysql --datadir=/path/to/existing-datadirRun mysql_upgrade. For example:
shell>
bin/mysql_upgrade -u root -ppasswordmysql_upgrade examines all tables in all databases for incompatibilities with the current version of MySQL. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities.
Notemysql_upgrade should not be used when the server is running with
--gtid-mode=ON. See GTID mode and mysql_upgrade for more information.mysql_upgrade does not upgrade the contents of the help tables. For upgrade instructions, see Section 6.1.9, “Server-Side Help”.
Performing a Logical Upgrade
This section describes how to perform a logical upgrade. Review Before you Begin before proceeding.
To perform a logical upgrade:
Review the changes described in Section 2.11.1.1, “Changes Affecting Upgrades to MySQL 5.7” for steps to be performed before upgrading.
Export your existing data from the previous MySQL version:
shell>
mysqldump --add-drop-table --routines --events
->--all-databases --force > data-for-upgrade.sqlNoteUse the
--routinesand--eventsoptions with mysqldump (as shown above) if your databases include stored programs. The--all-databasesoption includes all databases in the dump, including themysqldatabase that holds the system tables.ImportantIf you have tables that contain generated columns, use the mysqldump utility provided with MySQL 5.7.9 or higher to create your dump files. The mysqldump utility provided in earlier releases uses incorrect syntax for generated column definitions (Bug #20769542). You can use the
INFORMATION_SCHEMA.COLUMNStable to identify tables with generated columns.Shut down the old MySQL server. For example:
shell>
bin/mysqladmin -u root -ppasswordshutdownInstall MySQL 5.7. For installation instructions, see Chapter 2, Installing and Upgrading MySQL.
Initialize a new data directory:
shell>
mysqld --initialize --datadir=/path/to/5.7-datadirCopy the temporary
'root'@'localhost'password printed to your screen or written to your error log for later use.Start the MySQL 5.7 server, using the new data directory. For example:
shell>
bin/mysqld_safe --user=mysql --datadir=/path/to/5.7-datadirReset the
rootpassword:shell>
mysql -u root -p
Enter password:****<- enter temporary root password
mysql>ALTER USER USER() IDENTIFIED BY 'your new password';Load the previously created dump file into the new MySQL server. For example:
shell>
bin/mysql -u root -ppassword--execute="source data-for-upgrade.sql" --forceRun mysql_upgrade. For example:
shell>
bin/mysql_upgrade -u root -ppasswordmysql_upgrade examines all tables in all databases for incompatibilities with the current version of MySQL. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities.
Notemysql_upgrade should not be used when the server is running with
--gtid-mode=ON. See GTID mode and mysql_upgrade for more information.mysql_upgrade does not upgrade the contents of the help tables. For upgrade instructions, see Section 6.1.9, “Server-Side Help”.
Configure MySQL to perform a slow shutdown by setting
innodb_fast_shutdownto0. For example:shell>
bin/mysql -u root -ppassword--execute="set global innodb_fast_shutdown=0"Shut down and restart the MySQL server to ensure a clean shutdown and startup. For example:
shell>
bin/mysqladmin -u root -ppasswordshutdown
shell>bin/mysqld_safe --user=mysql --datadir=/path/to/5.7-datadir
Upgrade Troubleshooting
If problems occur, such as that the new mysqld server does not start or that you cannot connect without a password, verify that you do not have an old
my.cnffile from your previous installation. You can check this with the--print-defaultsoption (for example, mysqld --print-defaults). If this command displays anything other than the program name, you have an activemy.cnffile that affects server or client operation.If, after an upgrade, you experience problems with compiled client programs, such as
Commands out of syncor unexpected core dumps, you probably have used old header or library files when compiling your programs. In this case, check the date for yourmysql.hfile andlibmysqlclient.alibrary to verify that they are from the new MySQL distribution. If not, recompile your programs with the new headers and libraries. Recompilation might also be necessary for programs compiled against the shared client library if the library major version number has changed (for example fromlibmysqlclient.so.15tolibmysqlclient.so.16.If you have created a user-defined function (UDF) with a given name and upgrade MySQL to a version that implements a new built-in function with the same name, the UDF becomes inaccessible. To correct this, use
DROP FUNCTIONto drop the UDF, and then useCREATE FUNCTIONto re-create the UDF with a different nonconflicting name. The same is true if the new version of MySQL implements a built-in function with the same name as an existing stored function. See Section 10.2.4, “Function Name Parsing and Resolution”, for the rules describing how the server interprets references to different kinds of functions.
mysql 升级方法的更多相关文章
- MySQL 升级方法指南大全
原文:MySQL 升级方法指南大全 通常,从一个发布版本升级到另一个版本时,我们建议按照顺序来升级版本.例如,想要升级 MySQL 3.23 时,先升级到 MySQL 4.0,而不是直接升级到 MyS ...
- 详细讲解安全升级MySQL的方法
MySQL升级是非常必要的. 我们在Percona Support上列出了关于MySQL升级最佳实践的各种问题.这篇文章推荐了一些不同情况下升级MySQL的方法. 为什么MySQL升级是必须的? 原因 ...
- MySQL关闭过程详解和安全关闭MySQL的方法
MySQL关闭过程详解和安全关闭MySQL的方法 www.hongkevip.com 时间: -- : 阅读: 整理: 红客VIP 分享到: 红客VIP(http://www.hongkevip.co ...
- PHPnow For ASP&&ASP.NET&&MongoDB&&MySQL支持VC6.0编译器&&MySQL升级
可能和大家熟悉的是LAMP,Linux+Apache+Mysql+PHP,在Windows上,可能大家比较熟悉的是WAMP,Windows+Apache+Mysql+PHP,这是一个集成环境,说到集成 ...
- MySQL升级指南
一 .MySQL升级 1.官方升级策略 注意 升级过程中必须使用具有管理权限的MySQL帐户来执行SQL语句. 1.升级方法 逻辑升级: 涉及使用 mysqldump从旧的MySQL版本导出现有数据 ...
- mysql升级的一些踩坑点
升级的方法一般有两类: 1.利用mysqldump来直接导出sql文件,导入到新库中,这种方法最省事也最保险 缺点:大库的mysqldump费时费力. 2.直接替换掉 mysql 的安装目录和 my. ...
- Linux服务器上的禅道迁移及升级方法(Linux to Linux)
由于阿里云服务器(Linux系统)到期停用,故需要将部署在该服务器上的禅道迁移到新的Linux服务器上.另外,借此机会,正好可以对旧版禅道进行一次升级.下面总结此次迁移和升级的具体操作方法. 一.禅道 ...
- oracle 11g RAC 补丁升级方法
一.自动升级方法 使用auto方式在两节点分别进行PSU的安装,安装PSU前注意更新opatch工具至PSU所要求版本,p22191577补丁包括GI和DB,分别执行即可. 两节点分别grid用户执行 ...
- linux系统下yum 安装mysql的方法
菜鸟一个,记录下yum 安装mysql的方法,给需要的朋友也做个参考吧. 弄了个新vps,想安装最新版的mysql,网上查了相关资料,记录如下: 1.安装查看有没有安装过: yum ...
随机推荐
- .NET中的Newtonsoft.Json.JsonConvert.SerializeObject(string a)
1.將string a 序列化為Json格式: 2.使用條件:將Newtonsoft.Json.dll作為引用添加到項目中.下载地址在这:http://json.codeplex.com/
- 【转】Hive学习路线图
原文博客出自于:http://blog.fens.me/hadoop-hive-roadmap/ 感谢! Hive学习路线图 Hadoop家族系列文章,主要介绍Hadoop家族产品,常用的项目包括Ha ...
- 内存中的static、const实现形式
最近在考虑下半年找工作的事情,看了不少面试题目,其中还是蛮有收获的,把基础好好复习了一遍.比如这个题目,static.const现形式,static和const类型的变量在写程序的时候也写了很多,不过 ...
- Java的位运算符—— 与(&)、非(~)、或(|)、异或(^)
位运算符主要针对二进制,它包括了:“与”.“非”.“或”.“异或”.从表面上看似乎有点像逻辑运算符,但逻辑运算符是针对两个关系运算符来进行逻辑运算,而位运算符主要针对两个二进制数的位进行逻辑运算.下面 ...
- Windows下Mysql5.6启用监控执行脚本的日志
修改my.ini (我的MySQL安装位置是:E:\MySQL\MySQL Server 5.6) log-output=FILE general-log=1 general_log_file=&qu ...
- 进入GRUB改root用户密码
开机读取倒计时时按任意键----e---->选择第二行 kernel ---->按e, 再按空格 >输入1----回车--->选择kernel输入b----> passw ...
- 关于JPA封装数据库数据到实体不调用属性的get和set的方法解决办法
今天发现JPA封装数据库数据到实体并不调用属性的get和set的,郁闷,本来想在set方法做改字段的值处理的谁知道遇到这个情况: @Column(name = acode) @Access(value ...
- 关于表格中td自动换行做法
两个条件 一是给table中第一个tr(也就是表头)下的td或者th宽度,代码如下 而是让文字碰到边界自动换行 css属性 style="word-wrap:break-word;word- ...
- fastJson泛型如何转换
引子 现在负责的业务 和 json 打交道比较多, 最近使用fastJson框架 json串转成泛型对象遇到了一个异常 : java.lang.ClassCastException 还原下场景 : 模 ...
- js获取当前页面的url信息方法
例如网址:http://localhost:12085/My/OrderM.aspx 设置或获取对象指定的文件名或路径. alert(window.location.pathname) 输出结果:/M ...