mongodb can be connected through php connection without permission authentication, and the data can be read out.
$con = new MongoClient();
//
but after adding user rights authentication, it keeps prompting fatal error, authentication failed, etc., that the user name and password are correct and do not have permission.
$con = new MongoClient("mongodb://test:test123@localhost:27017/phptest");
this sentence has been connected incorrectly.
but you can connect through the client
> mongo phptest -u test -p test123
so that you can read and write normally.