原因:版本差异,4.0的和5.0默认的验证方式的不一样 SCRAM-SHA-251 SCRAM-SHA-256
方法一:
修改配置文件校验方式,然后进MongoDB shell 重新修改密码
方法二:
使用官方工具mongorestore,而不是使用MongoDB根目录下面的
安装:
https://fastdl.mongodb.org/tools/db/mongodb-database-tools-windows-x86_64-100.5.3.msi
使用 cd 到安装的bin目录:
cd "D:\Program Files (x86)\mongodb_tool\bin"
再使用导入命令:
.\mongorestore -h 192.168.10.8 -u 账号 -p 密码 --authenticationDatabase admin -d 库名 存储导出数据的目录
.\mongorestore -h 192.168.10.8 -u admin -p 123456 --authenticationDatabase admin -d test C:\Users\Administrator\Downloads\test