注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

PostgreSQL 中文网

 
 
 

日志

 
 

MySQL5.6 升级到 MySQL5.7 后 HELP 表没有更新  

2016-07-06 10:13:55|  分类: MySQL |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
上篇博客 MySQL 5.6 升级到 MySQL 5.7 实践 介绍了使用 in-place 方式升级 MySQL5.6 到 MySQL5.7,升级后发现 HELP 命令没有更新,如下: 

--help 命令

root@localhost:mysql>\h rename table
Name: 'RENAME TABLE'
Description:
Syntax:
RENAME TABLE tbl_name TO new_tbl_name
    [, tbl_name2 TO new_tbl_name2] ...

This statement renames one or more tables.

The rename operation is done atomically, which means that no other
session can access any of the tables while the rename is running. For
example, if you have an existing table old_table, you can create
another table new_table that has the same structure but is empty, and
then replace the existing table with the empty one as follows (assuming
that backup_table does not already exist):

URL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html

Examples:
CREATE TABLE new_table (...);
RENAME TABLE old_table TO backup_table, new_table TO old_table;

备注:上面的链接依然是显示 5.6 版本,接着查看 HELP 系统表。

--查看 help_topic 系统表

root@localhost:mysql>select * from help_topic where name='RENAME TABLE'\G
*************************** 1. row ***************************
   help_topic_id: 65
            name: RENAME TABLE
help_category_id: 40
     description: Syntax:
RENAME TABLE tbl_name TO new_tbl_name
    [, tbl_name2 TO new_tbl_name2] ...

This statement renames one or more tables.

The rename operation is done atomically, which means that no other
session can access any of the tables while the rename is running. For
example, if you have an existing table old_table, you can create
another table new_table that has the same structure but is empty, and
then replace the existing table with the empty one as follows (assuming
that backup_table does not already exist):

URL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html


         example: CREATE TABLE new_table (...);
RENAME TABLE old_table TO backup_table, new_table TO old_table;

             url: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html
1 row in set (0.01 sec)

备注:系统表里显示的依然是 5.6 的链接,很是奇怪,查了下手册,有如下内容:
MySQL5.6 升级到 MySQL5.7 后 HELP 表没有更新 - francs - PostgreSQL DBA
 备注:原来 mysql_upgrade 不会更新 help 相关系统表的,解决方法:需要手工执行 $MYSQL_HOME/share/fill_help_tables.sql 脚本。

--fill_help_tables.sql 脚本
/opt/mysql/share/fill_help_tables.sql 脚本内容为刷新 help 四张系统表,部分内容如下图
MySQL5.6 升级到 MySQL5.7 后 HELP 表没有更新 - francs - PostgreSQL DBA
 

--导入 fill_help_tables.sql 脚本 

[mysql@db1 ~]$ mysql -uroot -p -D mysql < /opt/mysql/share/fill_help_tables.sql
Enter password: 

备注:脚本没有报错。

--测试

root@localhost:mysql>\h rename table
Name: 'RENAME TABLE'
Description:
Syntax:
RENAME TABLE tbl_name TO new_tbl_name
    [, tbl_name2 TO new_tbl_name2] ...

This statement renames one or more tables. The rename operation is done
atomically, which means that no other session can access any of the
tables while the rename is running.

For example, a table named old_table can be renamed to new_table as
shown here:

URL: http://dev.mysql.com/doc/refman/5.7/en/rename-table.html

Examples:
RENAME TABLE old_table TO new_table;

备注:刷新 HELP 系统表后, URL 链接已经调整到 5.7 版本。

--参考



  评论这张
 
阅读(94)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016