Mognodb数据库连接方式
标准连接
$m = new Mongo(“mongodb://${username}:${password}@localhost:${port}”);
其它连接
$m = new Mongo(“mongodb://localhost:${port}/${username}:${password}”);
有时(频繁刷新)链接中断时切换链接方式
本文介绍了MongoDB数据库的两种连接方式:标准连接与其它连接,并提到了在遇到链接频繁中断的情况时如何进行切换。
Mognodb数据库连接方式
标准连接
$m = new Mongo(“mongodb://${username}:${password}@localhost:${port}”);
其它连接
$m = new Mongo(“mongodb://localhost:${port}/${username}:${password}”);
有时(频繁刷新)链接中断时切换链接方式

被折叠的 条评论
为什么被折叠?
链接中断的解决方法&spm=1001.2101.3001.5002&articleId=80190751&d=1&t=3&u=a553dd14cd0741d2bf8b2ff0c9f2d92c)