How To See User Database On PGAdminIII with Heroku? - database

I set up PGAdmin III with my Heroku database.
I was wondering how I can see my Users database. I am still building my website so I wanted to test how they are being registered in the database.
However, all I see is tons of databases with strange "d10abc111ldlapsaman"-like names. How do I access my User database?
If PGAdmin III is not the right tool for this - what tool should I get to see my users of my still - in -development Heroku application?

You may have figured out your issue by now, but what you want to do is go to https://postgres.heroku.com. Look at your default connection settings for your database. Now, do the following in pgAdmin III using these settings:
File -> Add Server
Name: anything you want
Host: ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com
Port: 5432
Maintenance DB: yourdbname (in your example it would be d10abc111ldlapsaman)
Username: uiuskwljksjdkje (change to yours)
Password: sdjfj3##f333edfs (change to yours)
The other settings can stay at what they initially were.
You should no be connected to the server. Expand it and scroll through the long list until you find your database name (the one that you put as Maintenance DB).
You're done!

Updating the answer for someone who still needs it, like me:
Go to your heroku account and find your database credentials (you should open your app, then postgres on add-ons and finally settings):
screenshot
In pgadmin you should right-click on 'servers'-> create -> server and enter your credentials:
General/Name: the name that pgadmin will show (only for you)
Connection/Host name: Host in credentials
Connection/Port: Port in credentials (probably 5432)
Connection/Maintenance database: Database in credentials
Connection/Username: User in credentials
Connection/Password: Password in credentials (tip: check the box to save it)
SSL/SSL mode: Require
Advanced/DB restriction: your database (same as maintenance db) -> this will filter only your db of the many others that will spam if you don't do that.

Related

How can I get a passwordless remote connection (OS authentication) to Oracle DB?

I'm considering using remote OS authentication to connect to an Oracle database (version 11g). What are the guidelines for using [remote_os_authent]
Here's what I want to do:
We set up a catalog DB to used by RMAN to store metadata about Oracle databases.
I want to connect to the catalog DB via the local machine and execute this command for resync catalog db:
rman target sys/pass#localdb;
connect catalog catuser/password#catdb;
RESYNC CATALOG;
Is it possible for me to do this through oracle Enterprise Manager job?
(I did this process by calling the execute file, but the problem is that the passwords are clear in the executable file.)
I need it because I do not want user passwords to be available and visible.
I can't use oracle valet for passwordless connection.
Using remote os authentication is considered a bad habit because it is insecure.
If you want to have scripting without having to store passwords in a readable format to prevent leaking passwords, easiest is to use the oracle wallet for this.
This still keeps you busy maintaining passwords in the database and in the wallet but it is pretty safe.
Your connection would be something line sqlplus /#tns_alias
where the tns_alias is the key into the wallet that fetches the username and the password.
An example of setup can be found here: http://ronr.blogspot.com/2017/01/cleartext-userid-and-passwords-in.html
An other option could be to enable Central Managed Users (CMU) and kerberos. This does need quite a bit of setup and is less suitable for scripting. For interactive use it works very nice, assuming you have kerberos correctly setup.
An example of CMU setup can be found here: https://blog.pythian.com/part-1-creating-an-oracle-18c-centrally-managed-users-testbed-using-oracle-cloud-infrastructure/
Please change back remote_os_authentication to false. It is not safe because users can easily be spoofed.

Publicly Visible Database Password on Github an issue?

I'm running an express server and I am very new to databases. If I have a public repo on Github of my express server and have this line of code publicly visible in one of the files:
const pool = new Pool({
user: "postgres",
host: "localhost",
database: "postgres",
password: "dummypassword",
post: 5432
});
Can people somehow connect to my PSQL database using my 'dummypassword' and mess up people's accounts that are stored in that database? I am planning to deploy it to DigitalOcean and I am wondering if this could be an issue somehow later down the road.
Thanks :)
If dummypassword is your true database password, then yes, this is absolutely a problem. You would literally be giving hackers instructions on exactly how to connect to your database! Don't do this.
Look into using dotenv on npm. This will allow you to create a .env file that can hold this precious information on a server outside of version control i.e. Github.
https://www.npmjs.com/package/dotenv
To expound on this, I would always err on the side of caution when dealing with database credentials. Say someone did get access to this information but that wasn't the actual database password, but the rest of the credentials were. The intruder now knows what kind of database you are running, where it's located, what port, and the username. All they need is the password in order to gain access to your entire production database and all of your users information.
I'm assuming you are saying; can someone connect to my production database ONCE you have changed the password for your production database?
If so then there is nothing in your example that isn't default so the answer is no.
If you're saying that "dummypassword" will be in production then yes that would NOT be a good idea, but I'm guessing you're not saying that.

What Registration Properties are needed to get Database Workbench up and running?

I am a Database Workbench fan from way back, but bizarrely have not used it for quite awhile.
I downloaded a trial version and am trying to "Register Server" as a first step.
The problem is I don't know what to use for which properties. I need to know:
Alias
Host
Instance
With "Use SQL Server Authentication" checked:
Username
Password
I've tried to guess my way through what is needed where, but nothing has worked.
I can connect to the database in (C#) code with this connection string:
"SERVER=PlatypusSQL42;DATABASE=duckbilldata;UID=youinnocentdog;PWD=contrasena;Connection Timeout=0";
And so I have tried these values:
Alias: DBWBSQLServer
Host: PlatypusSQL42
Instance: duckbilldata
Username: youinnocentdog
Password:contrasena
..and this:
Alias: PlatypusSQL42
Host: duckbilldata
Instance:
Username: youinnocentdog
Password:contrasena
...but with both of them, I get, "[DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found."
What values are needed?
The instance is not the database in the server you are connecting to. You can actually have more than one Sql Server running in the same operating system. You're using the default instance, so don't use that field or leave it blank.
Host: PlatypusSQL42
Username: youinnocentdog
Password:contrasena

Connect to a heroku database with pgadmin

I would like to manage my Heroku database with pgadmin client. By now, I've been doing this with psql.
When I use data from heroku pg:credentials to connect de DB using pgadmin, I obtain:
An error has occurred:
Error connecting to the server: FATAL: permission denied for database
"postgres" DETAIL: User does not have CONNECT privilege.
How to achieve the connection?
Open the "Properties" of the Heroku server in pgAdminIII and change the "Maintenance DB" value to be the name of the database you want to connect to.
The default setup is suitable for DBAs et al who can connect to any database on the server, but apparently that isn't true in your case.
After you change the Maintenance DB name as suggested by araqnid's answer above, you should also add your database to the DB restrictions field because without this you will see thousands of databases and you may not be able to find yours in the list if the list is too long.
More details here - How to hide databases that I am not allowed to access
This is for pgAdmin 4
In order to connect pgAdmin to your database (postgres instance in Heroku), do the following:
Login to Heroku, and select the application in which you have the database
Select the Resources tab and then click on "Heroku Postgres Ad-on" (see below). This will open up a new tab.
Select the Settings tab and then click on "View Credentials..." (see below)
You will get the following information that you will use in pgAdmin:
Go to pgAdmin, and create a new server
In the General tab, give a useful name
In the Connection tab, fill the info you got at Heroku
In order to avoid seeing thousands of databases, you need to add your database name to DB restriction in the Advanced tab (see below)
We require SSL for connections outside Heroku. Please verify whether you're forcing SSL in your client.
Answered more thoroughly here: Connecting pgAdmin3 to Postgres on Heroku
We don't allow connections to the postgres database, so be sure to set Maintenance DB to your database name, and be sure to use SSL.
Change the Maintenance Database to the name of your Database, e.g. dva70000p0090. This should work.
the db password local isnt the same db password heroku. please check the heroku ip postgtres address and extrac

Authentication with ADAM. How to connect ApacheDS Studio with ADAM

I am new with AD, I just intalled ADAM in my windows xp. Then I have created a new
instance following the steps, everything good:
Install a unique instance of ADAM.
Instance name: dash
Computers will connect to this instance of ADAM using the following ports:
LDAP port: 389
SSL port: 636
ADAM replication will use Negotiate authentication.
Store ADAM program files in the following location:
C:\WINDOWS\ADAM
Store ADAM data files in the following location:
C:\Archivos de programa\Microsoft ADAM\dash\data
Store ADAM data recovery information in the following location:
C:\Archivos de programa\Microsoft ADAM\dash\data
Run ADAM using the following account:
NT AUTHORITY\NetworkService
Set up the following account to administer ADAM:
JUANOX\Juano
Create the following application directory partition:
dc=xxxx,dc=com
After that I wanted to use ApacheDS Studio in order to connect to ADAM. But I faced this problem. Which user/password should I use for the connection?
Well, I tried "ADAM ADSI Edit" in order to create the connection, and I have this options:
Connection Name=dash
ServerName=localhost:389
DistinguishName or Naming Context:dc=xxxx,dc=com
The account of the currently logged on User
After use this configuration, I successfully created the connection
But I dont know the user/password!. I tried with JUANOX\Juano (this is my user in Windows) and "password", with Juano and password in ApacheDS Studio and nothing happens. I know that I dont need this app in order to admin ADAM (I could use ADAM ADSI Edit). But I need the information, since I want to manually connect to ADAM with an application that I am doing. I NEED THIS INFORMATION.
So?? what I am missing?
Thanks in advance
Well, My mistake from the beggining. I erased the instance and I have created a new one, following this link:
http://www.coreblox.com/blog/tag/adam/
So, the solution was to create a admin user with "ADAM ADSI Edit". I was used to ApacheDS, and I always used the default user/pass. So, this was the mistake.
After creating the ADmin user, I was able to login in ApacheDS Studio Tool with the new user/pass :)
I hope this help some one else :)

Resources