重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2368|回复: 0
打印 上一主题 下一主题

[命令及语法] mysql登陆中的大S与小s

[复制链接]
跳转到指定楼层
楼主
发表于 2018-7-9 15:16:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
linux中选项区分大小写很正常,比如大  R, 与小r,大D 与小d,特殊权限的 S 小s等等 ,
那么 mysql中的登陆,也一样存在大小写之分,比如大S就和小s就不一样。

具体举例如下 :


[mysql@dbserver bin]$ ./mysql -uroot -pmysql -s /data/db/mysql.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/home/mysql/data/db/mysql.sock' (111)

我这里明明是写的 -s /data/db/mysql.sock

怎么提示我: Can't connect to local MySQL server through socket '/home/mysql/data/db/mysql.sock'


赶紧看看mysql的帮助:

./bin/mysql --help

...
  -s, --silent        Be more silent. Print results with a tab as separator,
                      each row on new line.
  -S, --socket=name   The socket file to use for connection.
...

原来 小s是表示静默,大S 才表示 sock

马上更换 成 S

[mysql@dbserver bin]$ ./mysql -uroot -pmysql -S /data/db/mysql.sock
。。。
Server version: 8.0.11 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

mysql>


是不是已经进来了。

当然,还有几个也要注意,特别是大P 和 小p,一个表示端口port,一个表示口令password,大小Hh,大小Uu,也要注意的。

  -B, --batch         Don't use history file. Disable interactive behavior.
                      (Enables --silent.)
  -b, --binary-as-hex Print binary data as hex

  -c, --comments      Preserve comments. Send comments to the server. The
                      default is --skip-comments (discard comments), enable
                      with --comments.
  -C, --compress      Use compression in server/client protocol.
  -e, --execute=name  Execute command and quit. (Disables --force and history
                      file.)
  -E, --vertical      Print the output of a query (rows) vertically.
  -h, --host=name     Connect to host.
-H, --html          Produce HTML output.
  -n, --unbuffered    Flush buffer after each query.
  --column-names      Write column names in results.
                      (Defaults to on; use --skip-column-names to disable.)
  -N, --skip-column-names
                      Don't write column names in results.
-p, --password[=name]
                      Password to use when connecting to server. If password is
                      not given it's asked from the tty.
-P, --port=#        Port number to use for connection or 0 for default to, in
                      order of preference, my.cnf, $MYSQL_TCP_PORT,
                      /etc/services, built-in default (3306).
  -s, --silent        Be more silent. Print results with a tab as separator,
                      each row on new line.
  -S, --socket=name   The socket file to use for connection.
  -u, --user=name     User for login if not current user.
  -U, --safe-updates  Only allow UPDATE and DELETE that uses keys.
  -v, --verbose       Write more. (-v -v -v gives the table output format).
  -V, --version       Output version information and exit.




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-24 11:24 , Processed in 0.096153 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表