赞
踩
springboot使用正确的url、用户名、密码(密码为纯数字)连接mongodb出现认证失败问题:
com.mongodb.MongoCommandException: Command failed with error 18: ‘Authentication failed.’ on server ip:27017.
出现原因:默认使用的为字符数组接收密码,数字转换为字符后得到的字符并不是数字对于的字符,例如数字1对于的字符不是字符‘1’
解决方案:对于纯数字的密码,只需加入引号即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。