如何在 MySQL 5.6 命令行客户端中使用 --verbose 标志?
How to use the --verbose flag in the MySQL 5.6 command line client?
按照标志列表 here,顶部关于用法的行:Usage: mysql [OPTIONS] [database]
.
我是运行Windows8;我的 table 是 "contact";我想为 source C:/myfile.sql
创建一个启用详细选项的 tee 文件。
我试过 mysql -v contact
、-v contact
、--verbose contact
、--verbose source C:/myfile.sql
和其他各种方法。
编辑:adding screenshot of where I'm trying to run this, in case it helps.
应该可以,注意数据库名称。
mysql -v contact
如果您的数据库需要登录:
mysql -v -udbuser -p contact
冗长的交互式会话的正确语法是:
c:\> mysql -u yourUser -p -v yourDatabase
这将启动一个交互式会话(提示您输入密码),并将 yourDatabase
设置为会话的默认数据库。
在此交互会话中,发出 tee
命令:
mysql> tee c:/temp/my.out
现在您可以获取脚本:
mysql> source c:/myfile.sql
当然,您只需在命令提示符中输入即可避免所有这些痛苦:
c:\> mysql -u yourUser -pYourPassword -v yourDatabase < myfile.sql > my.out
这将:
- 将
myfile.sql
的内容推送到 "interactive" mysql 会话...这实际上是一个批处理过程
- 将批处理的所有内容重定向到
my.out
参考:
按照标志列表 here,顶部关于用法的行:Usage: mysql [OPTIONS] [database]
.
我是运行Windows8;我的 table 是 "contact";我想为 source C:/myfile.sql
创建一个启用详细选项的 tee 文件。
我试过 mysql -v contact
、-v contact
、--verbose contact
、--verbose source C:/myfile.sql
和其他各种方法。
编辑:adding screenshot of where I'm trying to run this, in case it helps.
应该可以,注意数据库名称。
mysql -v contact
如果您的数据库需要登录:
mysql -v -udbuser -p contact
冗长的交互式会话的正确语法是:
c:\> mysql -u yourUser -p -v yourDatabase
这将启动一个交互式会话(提示您输入密码),并将 yourDatabase
设置为会话的默认数据库。
在此交互会话中,发出 tee
命令:
mysql> tee c:/temp/my.out
现在您可以获取脚本:
mysql> source c:/myfile.sql
当然,您只需在命令提示符中输入即可避免所有这些痛苦:
c:\> mysql -u yourUser -pYourPassword -v yourDatabase < myfile.sql > my.out
这将:
- 将
myfile.sql
的内容推送到 "interactive" mysql 会话...这实际上是一个批处理过程 - 将批处理的所有内容重定向到
my.out
参考: