免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1661 | 回复: 1
打印 上一主题 下一主题

mysql5.6命令行传递密码无法登陆 [复制链接]

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2015-09-16 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-09-13 21:55 |只看该作者 |倒序浏览

$ /usr/local/mysql/bin/mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

而不传递密码则能正常登录
$ /usr/local/mysql/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.25-73.1-log Source distribution

Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

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>

现在用一些工具比如sysbench --mysql-user=root --mysql-password=123456 和一些程序连接时候没法使用了,该怎么解决这个问题

论坛徽章:
45
2016猴年福章徽章
日期:2016-02-18 16:42:24平安夜徽章
日期:2015-12-27 09:46:0315-16赛季CBA联赛之八一
日期:2015-12-15 17:08:23黄金圣斗士
日期:2015-12-11 09:16:31天蝎座
日期:2015-12-11 09:16:22戌狗
日期:2015-12-11 09:16:19程序设计版块每周发帖之星
日期:2015-12-11 09:15:21操作系统版块每周发帖之星
日期:2015-12-11 09:15:16IT运维版块每周发帖之星
日期:2015-12-11 09:15:09IT运维版块每月发帖之星
日期:2015-12-11 09:15:01CU十四周年纪念徽章
日期:2015-12-11 09:14:40操作系统版块每日发帖之星
日期:2015-12-11 09:13:36
2 [报告]
发表于 2015-09-20 17:26 |只看该作者
    When you run a client program to connect to the MySQL server, it is inadvisable to specify your password in a way that exposes it to discovery by other users. The methods you can use to specify your password when you run client programs are listed here, along with an assessment of the risks of each method. In short, the safest methods are to have the client program prompt for the password or to specify the password in a properly protected option file.

Store your password in an option file. For example, on Unix, you can list your password in the [client] section of the .my.cnf file in your home directory:
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP