Code Monkey home page Code Monkey logo

Comments (9)

itschrono avatar itschrono commented on June 23, 2024

Hello, if you have a mongo container running you should use his name as host. The other are from the user(s) you created with init script or env variable. If you have only an "admin" user you should omit "Database" so you have access to your others databases.

from mongodb-php-gui.

amrithadevadiga22 avatar amrithadevadiga22 commented on June 23, 2024

HI, i tried to login via admin and gave connection as Host=127.0.0.1 and port=27017 , got error
{
"error": {
"code": 13053,
"message": "No suitable servers found (serverSelectionTryOnce set): [connection refused calling ismaster on '127.0.0.1:27017']"
}
}

note : i checked in host machine that mongo db active and running ..please suggest me what i can do for this..
here i don't have mongo container , i have configured mongo db in dedicated host

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on June 23, 2024

Hello. If your MongoDB host is accessible from Internet: use its IP address as host. Else: use 172.17.0.1 as host. Let me know if it works...

from mongodb-php-gui.

amrithadevadiga22 avatar amrithadevadiga22 commented on June 23, 2024

Hi, yes it worked for login, steps i followed like
created a user in mongo cli
and used same user credential and database name in login page with host 172.17.0.1 and port 27017.

but if i try to add user from ui for that DB it is giving me same error " message": "No suitable servers found (serverSelectionTryOnce set): [connection refused calling ismaster on '127.0.0.1:27017']"" please find attachment

and one thing with out giving DB name i am not able to login..so how to login as a admin ? any suggestion for this ?

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on June 23, 2024

So when you try to add an user from UI, there's an error? Can you please attach a screenshot?

from mongodb-php-gui.

amrithadevadiga22 avatar amrithadevadiga22 commented on June 23, 2024

Screenshot from 2020-11-18 11-10-06
please find screenshot

after adding query it is not giving result also no error..
Screenshot from 2020-11-18 11-08-16

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on June 23, 2024

@amrithadevadiga22 Hi. Thanks for the screenshots. To bypass the error "The SCRAM_SHA_256 authentication mechanism requires libmongoc built with ENABLE_SSL", follow these steps:

  1. Replace Dockerfile at project's root directory with this one:
FROM php:7.4-cli-alpine
RUN apk update && apk upgrade

# Clone project repository.
RUN apk add --no-cache git
WORKDIR /opt/mongodb-php-gui
RUN git clone https://github.com/SamuelTS/MongoDB-PHP-GUI.git .

# Enable MongoDB PHP ext.
RUN apk add --no-cache autoconf build-base curl-dev openssl-dev
RUN pecl install mongodb-1.8.2 && docker-php-ext-enable mongodb

# Install PHP dependencies.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer install

# Start PHP built-in server.
EXPOSE 5000
CMD ["php", "-S", "0.0.0.0:5000"]
  1. Run again docker build -t mongodb-php-gui . at project's root directory.
  2. Run docker run -it -p 5000:5000 mongodb-php-gui at project's root directory.
  3. Open your browser at this address: http://127.0.0.1:5000/ to access GUI.

Then, about querying, you don't need to write full command db.mycol.find().pretty(). Just write for example { "_id": 1 }.

from mongodb-php-gui.

amrithadevadiga22 avatar amrithadevadiga22 commented on June 23, 2024

@SamuelTS Hi, Thanks for the reply..
i want to know ,what should be user role for a database to perform any operation ..i was getting authentication error for a user with the role "userAdmin" with user name "employee", for db "employee"

and one more thing like i tried some basic mongo db query commands
eg: db.COLLECTIONNAME.findOne()
db.mycol.find({ $and: [ {:}, { :} ] })
db.mycol.find().pretty() etc..

non of the query giving output..as you gave example above like "{ "_id": 1 }", i didn't get how it actually working..and if i want to query the database with some condition how can i write a query !!

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on June 23, 2024

@amrithadevadiga22 Hello.

I suggest you to drop then re-create user named "employee" for db "employee" with role readWrite.
Then logout, login with user "employee". Don't forget to use "employee" db when you fill login form.

You can query database using {} syntax. Input only value passed normally to .find(). Example:

Query

from mongodb-php-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.