$conn = new Mongo ("mongodb://admin:admin@localhost:27017/local"); This is line 11th.
After writing this, the error
( ! ) Deprecated:main (): The Mongo class is Deprecated, please use the Mongoclient class in D:\bzyweb\test2\conn.php on line 11
Call Stack
# Time Memory Function location
1 0.0010 238592 {main} (): \conn.php:0
( ! ) Fatal error:uncaught exception ' mongoconnectionexception ' with message ' Failed to connect To:localhost:27017:authentica tion failed on database ' local ' with username ' admin ': Auth fails ' in D:\bzyweb\test2\conn.php on line 11
( ! ) mongoconnectionexception:failed to connect to:localhost:27017:authentication Failed in database ' local ' with username ' Admin ': Auth fails in D:\bzyweb\test2\conn.php on line 11
Call Stack
# Time Memory Function location
1 0.0010 238592 {main} (): \conn.php:0
2 0.0010 239720 __construct (). \conn.php:11
Reply to discussion (solution)
Deprecated:main (): The Mongo class is Deprecated, please use the Mongoclient class
Objection: Main (): MONGO class is obsolete, please use mongoclient class
echo "MONGO Contact:
";
$DB = new PDO ("Mongodb:host=localhost;port=27017;dbname=aaa", "admin", "admin");
$conn = new Mongoclient ("mongodb://admin:admin@localhost2:27017/local");
?>
Error hints
MONGO Contact:
( ! ) Fatal error:uncaught exception ' mongoconnectionexception ' with Message ' mongoclient::__construct (): ' In D:\bzyweb\ test2\conn.php on line 4
( ! ) Mongoconnectionexception:mongoclient::__construct (): In D:\bzyweb\test2\conn.php on line 4
Call Stack
# Time Memory Function location
1 0.0000 240416 {main} (): \conn.php:0
2 0.0000 240672 __construct (). \conn.php:4
What's yours? MONGO Manager?
You see how he wrote it.
is a mongoweb management address, I read a lot of writing, as if the link is so written, do not know why I made a mistake, so put out the structure of the database, I think this can be expressed more clearly
$DSN = "MONGODB://LOCALHOST:27017/ADMIN:ADMIN/AAA";
$m =new mongoclient ($DSN);
There's no error.