在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问题
最新推荐文章于 2022-10-30 20:05:38 发布