I have XML file in which all the connections are stored. I have already imported all the connections into SQL Developer. Now I have to give password of a particular schema to other people. How can I decrypt the password of a particular schema?
Related
I have multiple db connections setup in Oracle SQL Developer. Every username and password is stored with the "save Password" option in the Database connection.
I have a script that queries multiple db's.
SELECT * FROM table_on_DB1;
conn username/password#server:1521:DB2
SELECT * FROM table_on_DB2
Running this from the worksheet of DB1 works fine. But the pain is that the username and password are now in the script. I assume there is a way to use the stored username and password from SQL Developer. How can I use the stored username and password from Oracle SQL Developer?
I am trying to create a FOREIGN DATA WRAPPER and access the admin user with a password that is held in my .pgpass. Here is the code that I am using to create the wrapper:
create extension postgres_fdw;
CREATE SERVER source FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'test.us-west-2.rds.amazonaws.com', dbname 'test', port '5432');
CREATE USER MAPPING FOR CURRENT_USER
SERVER source
OPTIONS (user 'admin');
CREATE SCHEMA app;
IMPORT FOREIGN SCHEMA public
FROM SERVER source
INTO app;
My .pgpass has this value in it
test.us-west-2.rds.amazonaws.com:5432:test:admin:password
My statement fails each time when I try to import the schema. If I add the password to the USER MAPPING, then the connection works fine and there are no issues. What do I need to change to be able to make this connection?
If .pgpass is used, it would be the .pgpass file held in the home directory of the OS user who owns the PostgreSQL server process, not of the account running the client process. To prevent you from using someone else's password without permission, this will only work if you are the superuser, or if the user mapping was created by a superuser and had password_required set to false (and this latter option only works from v13).
There is no provision to proxy the client's .pgpass through for use on the server.
Below command used for connecting database through Firebird SQL.
CONNECT "C:\Users\vkaja\Desktop\testing_mysql\newdb.db"
In newdb.db file Schema, data are dumped from SQLite.
Here newdb.db has read-write permission. But error projected here is not a valid username and password.
Statement failed, SQLCODE = -902
Firebird doesn't care about the extension of the database file. fdb is 'standard', and gdb is historical, but it could be anything. However the database you are connecting to must be a Firebird database. You can't just open a database file from a different database system (eg SQLite).
Your problem is one of authentication: you are trying to authenticate without a username + password combination, and if you haven't set the appropriate environment variables, it means Firebird tries to authenticate with an empty user and password, which doesn't exist for your Firebird install. In general you also get this error if you use a username and password that is not known to Firebird.
But even if you fix the authentication problem, you would immediately get a different error: invalid database (or similar), because the file is not a Firebird database.
I am creating db2 schema by using create schema schemaName in mydb database, now while I connect the database by writing connect to mydb user schemaName;
it prompts to give a password.
My question is how to set a password to my existing schema in db2 database
A schema cannot have a password. A user can have a password, but the user does not necessarily match any schema. In DB2 authentication is delegated to the operating system (or other external authority), so you need to use whatever password belongs to the operating system user "schemaName".
I have the following code which connects to a database on my remote server (the connection script resides on the same server):
Database::$ErrorHandle = new PDO('pgsql:host=111.222.33.44;dbname=mydatabase;', 'postgres', 'mypassword', $db_settings);
The problem is I can change the password to be anything at all and the connection is still made! Like seriously what the hell!?!
Can my database be connected to (providing you know the IP and db name) by anyone from a PHP script running on a different server?
How can I enforce passwords, I have looked at the following stack overflow page and did what they said but still no luck:
How to change PostgreSQL user password?
I am running Ubuntu 12.04 server with PHP 5.5 and Apache2
Off course your postgresql database can be properly configured to only connect with authenticated users even certain users (Roles in Postgres) from certain IPs/sockets.
Some considerations:
Do you see data? Or can you just connect to the server? Can you list the databases?
Look at your pg_hba.conf and setup the proper permissions, per role per database per source
Did you grant access to the mydatabase to everyone? Which roles did you grant access?
Does the database have its tables in the public scheme? And granted access to the public?
Yes, with this configuration everyone who knows your IP and database name can connect to your database.