TP5.1连接mongodb问题

在windows下
/vendor/topthink/think-mongo/src/connection.php中的第152行:
h o s t = ′ m o n g o d b : / / ′ . ( host = 'mongodb://' . ( host=mongodb://.(config[‘username’] ? "{KaTeX parse error: Expected 'EOF', got '}' at position 19: …fig['username']}̲" : '') . (config[‘password’] ? “:{$config[‘password’]}@” : ‘’) . c o n f i g [ ′ h o s t n a m e ′ ] . ( config['hostname'] . ( config[hostname].(config[‘hostport’] ? “:{$config[‘hostport’]}” : ‘’);这样才不报错Authentication failed解决方案
在linux下必须为:
h o s t = ′ m o n g o d b : / / ′ . ( host = 'mongodb://' . ( host=mongodb://.(config[‘username’] ? "{KaTeX parse error: Expected 'EOF', got '}' at position 19: …fig['username']}̲" : '') . (config[‘password’] ? “:{$config[‘password’]}@” : ‘’) . c o n f i g [ ′ h o s t n a m e ′ ] . ( config['hostname'] . ( config[hostname].(config[‘hostport’] ? ":{KaTeX parse error: Expected 'EOF', got '}' at position 19: …fig['hostport']}̲" : '')."/".this->dbName;

你可能感兴趣的:(TP5.1连接mongodb问题)