抓我的头在这一个。
我可以使用-p
选项连接到mysql进行密码验证
kevzettler@kevs-mbp-3 radcade-wordpress % mysql -h localhost -P 3306 --protocol=tcp -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.7.40 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> \q
Bye
然而,当我尝试使用扩展的-password
选项时,它总是被拒绝访问。
kevzettler@kevs-mbp-3 radcade-wordpress % mysql -h localhost -P 3306 --protocol=tcp -u root -password='password'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'172.24.0.1' (using password: YES)
是否存在拒绝命令行密码的隐藏安全选项?
1条答案
按热度按时间qv7cva1a1#
long选项必须以两个破折号为前缀。
就像这样:
不是这样的:
对于一个选项,它就是
-p
短选项,后跟密码字符串assword=xyzzy
。在MySQL中,短
-p
选项不要求在选项字符和密码字符串之间有空格,这是因为-p
后面跟空格表示交互式地提示输入密码。