我正在学习mysql http://dev.mysql.com/doc/refman/5.7/en/batch-mode.html 。第二段说:
If you are running mysql under Windows and have some special characters in the file that cause problems, you can do this:
C:\> mysql -e "source batch-file"
什么是特殊字符?如果我在记事本中保存文件,文件中是否会自动保存特殊字符?如何知道它们是否存在?它们被隐藏了吗?
-e
标志有什么作用?在mysql文档中哪里可以找到它的解释?
最佳答案
-e
实际上是 --execute
的缩写,这可能就是您找不到它的原因。 http://dev.mysql.com/doc/refman/5.7/en/mysql-command-options.html#option_mysql_execute
Execute the statement and quit. The default output format is like that produced with --batch. See Section 5.2.4, “Using Options on the Command Line”, for some examples. With this option, mysql does not use the history file.
特殊字符是在 SQL 查询中需要转义的字符。当你遇到它们时你就会知道,因为 mysql 会产生错误。
关于mysql - e 标志和特殊字符在 mysql 中起什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39463110/