I wanted to enable auth and remote acccess.
for mongoose I use connect string: mongoose.connect('mongodb://username:password#host:port/database')
It works if I connect remotely with compass, but mongoose.connect returns invalid database name.
However if i remove database name from the string, mongoose connects but to 'test' database and can't perform any action as it has no permissions (my user only have permission to certain database).
I really don't understand why is that happening.
You have to specify the database name where username is stored
For example if user is in database
mongoose.connect('mongodb://username:password#host:port/database?authSource=database')
If user is in admin database:
mongoose.connect('mongodb://username:password#host:port/database?authSource=admin')
Related
I created a database using pqsl in the command line of my Mac with tables and users. Yet, when I connect to my psql database using pgAdmin4 it doesn't show my database?
Registered a server with name localhost.
Set the username to match the name of a user in the database I create using the command line.
Host name set to localhost.
Maintenance Database was set to the name of my database.
Set role to the same name as the user.
Tap Save.
Then under databases I don't find the name of my database at all, just api with none of my created tables??
Thanks for any help!
I have created a new sql account and assigned it dbmanager and loginmanager roles. It can be used to create new databases but I am not able to access the database afterwards with that user. When right clicking the new database to run a query, the login prompt apears and says that the security principal %user% can access the database under the current security context.
I am not able to alter or grant user any access to the DB now that I can't even run any queries.
The purpose here is that I have a powershell script that creates the databases and handles the automation under a spesific SQL user. What am I missing?
The login might lacks the necessary permissions to connect to the specified database. Logins that can connect to this instance of SQL Server but do not have particular database rights inherit the guest user's permissions. This is a security feature that prevents users from connecting to databases where they do not have permissions. When the guest user does not have CONNECT permission to the identified database and the trustworthy attribute is not set, this error message appears. When the guest user does not have CONNECT authorization to the listed database, this error message appears.
You can connect to the database in one of the following ways:
Grant the specific login access to the named database.
Grant the CONNECT permission to the database named in the error message for the guest user.
Enable the TRUSTWORTHY property on the database that has authenticated the user.
Please refer to the Microsoft Document for this error: MSSQLSERVER_916
I'm trying to connect to employee.fdb in Firebird3.0 (localhost) using FlameRobin 0.9.3 on a Ubuntu OS.
The connection to Firebird using isql has no issues. I can create users, roles, etc all from the terminal. However, when I attempt to make a connection using FlameRobin I receive a 335544344 "Error while trying to open file Permission denied" response.
This occurs with the SYSDBA profile and any other new user profiles that I create in isql. I can even create new users in FlameRobin but I cannot connect to any database. I've verified in /etc/firebird/3.0/firebird.conf that DatabaseAccess = Full and have attempted to access the db from a couple different folders in case this is a read/write issue. No success.
I feel like I'm missing something obvious. Any thoughts?
Added info in response to Mark (4/26):
The db is stored in /var/lib/firebird/3.0/data/. I have assumed this to be the default location for Firebird DBs and that the server automatically has access to it, but I suppose that might not be the case. Is there a way to confirm server permissions to this directory and/or is this the customary spot to store work?
Terminal Connection with ISQL:
daniel#daniel-desktop:~$ isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect '/var/lib/firebird/3.0/data/employee.fdb' user sysdba password 'xxxxxxx';
Database: '/var/lib/firebird/3.0/data/employee.fdb', User: SYSDBA
SQL>
FlameRobin Database Registration Info:
FlameRobin Error:
This is a permissions issue as #MarkRotteveel suggested. Problem was that I installed the server as a user and not as root. Problem solved by removing and reinstalling both Firebird and FlameRobin as root.
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.
So I am trying to setup authentication on MongoDB instance. This is the first time doing this. I currently have an instance running off of localhost with no authentication. I have created users with admin rights as well as two users with readwrite rights. I have tried to log in to the httpinterface using these users but it doesn't let me in. Also, I am trying to create a connection from another server to this database instance but it does not allow me to. If i login to the server through SSH and authenticate on the mongo shell it works fine and returns 1. Any thoughts or suggestions?
I get the following error from the Mongo Connection:
array(2) { ["ok"]=> int(0) ["errmsg"]=> string(130) "Failed to connect to: IP:PORT: Authentication failed on database 'DB' with username 'User': auth failed" }
This user was just created and has readWrite rights and I know the password is correct.