zoukankan      html  css  js  c++  java
  • mysql命令一些常用的选项

    1>要想禁用列名,可以使用下面的形式来指定选项:

    --disable-column-names
    --skip-column-names
    --column-names=0

    --disable和--skip前缀与=0后缀的效果相同:它们均关闭选项。

    可以用下述方法“启用”选项:

    --column-names
    --enable-column-names

    --column-names=1

    例如  mysql -uroot -ptest --disable-column-names

    mysql> use mysql;
    Database changed
    mysql> select * from db; --这里没有显示列名
    +---+---------+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
    -+---+---+---+
    | % | test    |  | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | Y | Y | Y | N
     | N | Y | Y |
    | % | test\_% |  | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | Y | Y | Y | N
     | N | Y | Y |
    +---+---------+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
    -+---+---+---+
    2 rows in set (0.00 sec)

    2>使用选项错误不退出

    C:Documents and SettingsAdministrator>mysql -uroot -ptest --abc
    mysql: unknown option '--abc'

    C:Documents and SettingsAdministrator>mysql -uroot -ptest --loose-abc
    Warning: mysql: unknown option '--loose-abc'
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 10
    Server version: 5.5.17 MySQL Community Server (GPL)

    3>直接登录 执行sql语句

    C:>mysql -uroot -ptest --execute="select 1+1" 数据库名称
    +-----+
    | 1+1 |
    +-----+
    |   2 |
    +-----+

    4>指定登录的接口

    --port=3309

    或者 -P3309 














  • 相关阅读:
    调整压力测试工具转载ibm
    Python装饰器的使用
    python操作mysql数据库
    python进程与线程的操作
    python selenium框架的Xpath定位元素
    在Ubuntu Server 12.04 x64下安装Graphite
    SQLCLR(一)入门
    DataSet操作
    ASP.NET传递中文参数乱码的解决方法
    c#.net常用函数和方法集
  • 原文地址:https://www.cnblogs.com/liaomin416100569/p/9331245.html
Copyright © 2011-2022 走看看