MySQL转储文件并注释掉行 [英] MySQL dump file and commented out lines

查看:76
本文介绍了MySQL转储文件并注释掉行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MySQL .sql文件(与phpMyAdmin转储)的顶部有这些行:

I have these lines at the top of a MySQL .sql file (dumped with phpMyAdmin):

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

但是它们似乎都被注释掉了.那么,当文件重新加载到数据库中时,MySQL将忽略它们吗?如果是这样,为什么还要生成这些行呢?

But they all seem to be commented out. So will MySQL ignore them when the file is loaded back into a database? If so, why generate these lines at all?

推荐答案

这些是针对特定版本的mySQL的条件注释.

These are conditional comments aimed at certain versions of mySQL.

来自

  • MySQL版本特定注释以/*!
  • 开头
  • 并以*/
  • 结尾
  • 版本号始终为5位数字
  • 版本号采用主发行版号的格式, 次要版本号,主版本号为1位数的修订号 次要版本和修订版本为2位数,左后加0的数字
  • 特定于版本的注释将定位到等于或高于该版本的任何版本 列出的版本号
    • MySQL version specific comments start with /*!
    • And end with */
    • Version numbers are always 5 digits
    • Version numbers are in the format major release number, minor release number, revision number with the major being 1 digit and the minor and revision being 2 digits left-padded with 0’s
    • Version specific comments will target any version equal to or higher than the version number listed

    这篇关于MySQL转储文件并注释掉行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆