MyCATApache / Mycat-Server

GNU General Public License v2.0
9.51k stars 3.85k forks source link

解决连接mongodb验证失败问题 #1494

Open junphine opened 7 years ago

junphine commented 7 years ago

class MongoDriver private MongoClientURI parseURL(String url, Properties defaults) { if (url == null) { return null; }

    if (!StringUtils.startsWithIgnoreCase(url, PREFIX)) {   
        return null;
    }

    //替换user:
    if(defaults.getProperty("user")!=null && defaults.getProperty("password")!=null ){
        url = url.replace(PREFIX, PREFIX+defaults.getProperty("user")+":"+defaults.getProperty("password")+"@");
    }
    LOGGER.info("Mongodb url:"+url);
magicdoom commented 7 years ago

提交pr