Coder Social home page Coder Social logo

Comments (6)

gangzi59185 avatar gangzi59185 commented on August 29, 2024 1

Haha, you're right. Thank you for your suggestion

from sql_exporter.

burningalchemist avatar burningalchemist commented on August 29, 2024

Hi @gangzi59185, I need more context to help you. Please share your DSN with redacted sensitive data. 👍

Also, please refer to the schema names here (we use dbUrl dependency to handle DSN): https://github.com/xo/dburl

from sql_exporter.

gangzi59185 avatar gangzi59185 commented on August 29, 2024
image The above are the parameters I connected to, because PostgreSQL has the concept of scheme, which defaults to pubic. However, my scheme is datago, and I don't know how to configure DSN to read data from datago's scheme

from sql_exporter.

burningalchemist avatar burningalchemist commented on August 29, 2024

Hey @gangzi59185, I guess the problem is that you're using special characters (@) in your password, so the entire string contains 2 @ making DSN impossible to parse.

In the README.md we have the following part:

If your DSN contains special characters in any part of your connection string (including
passwords), you might need to apply URL encoding (percent-encoding) to them. For example,
p@$$w0rd#abc then becomes p%40%24%24w0rd%23abc.

So in your case the password Datago@2021 should become Datago%402021. Please, give it a shot and let me know.

P.S. I was referring to the URL scheme name (postgres://) and not the database schema. It looks correct to me. 👍

from sql_exporter.

gangzi59185 avatar gangzi59185 commented on August 29, 2024

data_source_name: 'postgres://datago:xxxx@xxx:8000/mdmc_db?sslmode=disable&search_path=datago_db'
Thank you for your reply. I have fixed the password issue, but my problem is not a password issue. It is about the specified scheme in PostgreSQL. I have resolved it and added the parameter search_ Path=datago_ DB to specify a certain scheme, successfully read scheme=datago_ Data of db

from sql_exporter.

burningalchemist avatar burningalchemist commented on August 29, 2024

Hey @gangzi59185, I apologize, the terms are confusing. 👍 I'm glad you've found the solution, though. 😅 May I ask why can't you specify schema in your query? This is a pretty common practice. If not provided, it falls back to public, indeed. But otherwise it should generally work, so you don't need to specify it explicitly. Unless, there is a special situation, of course. 🙂

from sql_exporter.

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.