如何在MySQL 5.6命令行客户端中使用--verbose标志? [英] How to use the --verbose flag in the MySQL 5.6 command line client?

查看:227
本文介绍了如何在MySQL 5.6命令行客户端中使用--verbose标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处的标志列表中进行导航,并在顶部显示该行有关用法:Usage: mysql [OPTIONS] [database].

Going by the list of flags here, with the line at the top about usage: Usage: mysql [OPTIONS] [database].

我正在运行Windows 8;我的桌子是联系人";我想为source C:/myfile.sql创建一个tee文件,并启用详细选项.

I am running Windows 8; my table is "contact"; I want to create a tee file for source C:/myfile.sql with the verbose option on.

我尝试了mysql -v contact-v contact--verbose contact--verbose source C:/myfile.sql和其他各种方式.

I have tried mysql -v contact, -v contact, --verbose contact, --verbose source C:/myfile.sql, and various others.

添加屏幕快照,以备不时之需.

推荐答案

冗长的交互式会话的正确语法为:

The correct syntax for a verbose interactive session is:

c:\> mysql -u yourUser -p -v yourDatabase

这将启动一个交互式会话(提示您输入密码),并将yourDatabase设置为该会话的默认数据库.

This will launch an interactive session (prompting you for password), and set yourDatabase as the default database for the session.

在此交互式会话中,发出tee命令:

Once in this interactive session, issue a tee command:

mysql> tee c:/temp/my.out

现在您可以获取脚本了:

And now you can source your script:

mysql> source c:/myfile.sql

当然,您可以通过将其放在命令提示符中来避免所有这些麻烦:

Of course, you can avoid all this pain by simply putting this in your command prompt:

c:\> mysql -u yourUser -pYourPassword -v yourDatabase < myfile.sql > my.out

这将:

  1. myfile.sql的内容推送到交互式" mysql会话...这本质上是一个批处理过程
  2. 将批处理过程的所有内容重定向到my.out
  1. Push the contents of myfile.sql to an "interactive" mysql session... that's essentially a batch process
  2. Redirect all contents of the batch process to my.out


参考:


Reference:

这篇关于如何在MySQL 5.6命令行客户端中使用--verbose标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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