Solution to PHP link mongodb link interruption

不言
Release: 2023-03-25 12:00:02
Original
1799 people have browsed it

This article mainly introduces the solution to the sometimes interrupted link of php link to mongodb. It has a certain reference value. Now I share it with you. Friends in need can refer to it

Mognodb database connection method

Standard connection

$m = new Mongo(“mongodb://${username}:${password}@localhost:${port}”);
Copy after login

Other connections

$m = new Mongo(“mongodb://localhost:${port}/${username}:${password}”);
Copy after login

Sometimes (frequently refreshed) links Switch link mode when interrupted


##

The above is the detailed content of Solution to PHP link mongodb link interruption. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!