Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用密码中的特殊字符从终端连接到MySQL不起作用_Mysql_Quoting - Fatal编程技术网

使用密码中的特殊字符从终端连接到MySQL不起作用

使用密码中的特殊字符从终端连接到MySQL不起作用,mysql,quoting,Mysql,Quoting,我的MySQL密码包含@#。当我尝试使用此密码从终端连接到mysql时,我给出了一个bash event not found错误。 我该如何解决这个问题?我甚至不明白为什么密码会显示此错误。您需要确保引用特殊字符匹配模式其中是您的历史记录中的内容 以下是我的历史: [vagrant@localhost files]$ history 1 tail /var/log/httpd/error_log 2 ./tools/runcmd deploy latest 3 ./tools/runcmd

我的MySQL密码包含@#。当我尝试使用此密码从终端连接到mysql时,我给出了一个bash event not found错误。
我该如何解决这个问题?我甚至不明白为什么密码会显示此错误。

您需要确保引用特殊字符<代码>匹配模式
其中
是您的
历史记录中的内容

以下是我的历史:

[vagrant@localhost files]$ history
1  tail /var/log/httpd/error_log
2  ./tools/runcmd deploy latest
3  ./tools/runcmd deploy fntsy.2625
4  ./tools/runcmd deploy fntsy-2625
所以当我输入
时!1
我得到:

[vagrant@localhost files]$ tail /var/log/httpd/error_log
<!-- tail information here -->
[vagrant@localhost文件]$tail/var/log/httpd/error\u log
在您的情况下,命令行找不到ID为
@#
的事件,因为您的历史记录中没有与之匹配的事件


请尝试引用您的密码:
-p'
或完全忽略您的密码(调用
mysql-u-p
,它将提示您键入密码)。

您需要确保引用特殊字符<代码>匹配模式
其中
是您的
历史记录中的内容

以下是我的历史:

[vagrant@localhost files]$ history
1  tail /var/log/httpd/error_log
2  ./tools/runcmd deploy latest
3  ./tools/runcmd deploy fntsy.2625
4  ./tools/runcmd deploy fntsy-2625
所以当我输入
时!1
我得到:

[vagrant@localhost files]$ tail /var/log/httpd/error_log
<!-- tail information here -->
[vagrant@localhost文件]$tail/var/log/httpd/error\u log
在您的情况下,命令行找不到ID为
@#
的事件,因为您的历史记录中没有与之匹配的事件


请尝试引用您的密码:
-p'
或者干脆省略您的密码(调用
mysql-u-p
,它会提示您输入密码)。

还有一件事:美元符号在某些终端中是特殊的。我们有一个这样的系统密码,需要通过脚本输入。即使在引用了
-p'$Texas'
之后,它也不起作用。必须这样输入:
-p'\$Texas'
,这取决于shell。在bash中,
$
但不在
内,
`是相同的,因此
`将是一个字符文字。还有一件事:美元符号在某些终端中是特殊的。我们有一个这样的系统密码,需要通过脚本输入。即使在引用了
-p'$Texas'
之后,它也不起作用。必须这样输入:
-p'\$Texas'
,这取决于shell。在bash中,
$
中有意义,但在
'
中没有意义,并且
`是相同的,因此
`将是一个字符文本。