Why there isn't "create server" button in pgAdmin? - pgadmin-4

There in not "create - server" button in pgAdmin (postgres 14). There is only "create - server group". How to fix that?

Related

SQL Server LocalDb ProjectsV13 Connection Failure

Using SQL Server 2016 (localdb)\ProjectsV13, I created a database - let's call it MyDatabase. All was fine and dandy until I decided I no longer needed it...
So in SSMS 2016, while connected to (localdb)\ProjectsV13, I right clicked on MyDatabase and clicked "Delete".
Now when I try to establish a connection to (localdb)\ProjectsV13, it fails.
Here's the error message:
Cannot connect to (localdb)\ProjectsV13.
Cannot open database "MyDatabase" requested by the login. The login failed. Login failed for user 'MyDomain\MyUserName'. (Microsoft SQL Server, Error: 4060)
So even though I deleted the MyDatabase database (I know - I should of just run a DROP), SSMS is still trying to connect to MyDatabase which of course fails and then prevents me from connecting to (localdb)\ProjectsV13 at all - which is the real issue.
How can I resolve this so that SSMS doesn't try to connect to the deleted MyDatabase database when connecting to (localdb)\ProjectsV13?
Like Sean suggested, I think your default database is the problem. If you're using visual studio, right-click the server and click on the properties option. You'd see a 'Default Database Location' property. Alter the value.
If you're not using visual studio, then change your default database or check that your connection string does not attach the deleted database when you connect. E.g.
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\StaffLoginSystem.mdf;Integrated Security=True;Connect Timeout=30"
Check the value of 'AttachDbFilename' property and edit accordingly.

How to find Database Server Name

I have no idea about databases, and I googled but couldn't figure out. I'm running database on my machine. Is the 'database server name' localhost?
Yes "localhost" works and will connect to the default database instance (assuming once exists). Or "127.0.0.1" works. Or "." works too in many scenarios.
In Microsoft SQL Server Management Studio, in the Object Explorer pane, right click the server and select properties. In the pane, there should be a heading called "Connection" and in that heading a link to a new window called "View connection properties". The value next to "Server name" is the name of your server.

SQL Server Import Wizard "workgroup information file" error when importing Access .mdb

Is it possible to import an MS Access. mdb file into SQLExpress if I do not have MS Access installed? Reason I ask is because I am getting the following error when attempting to use the Import Wizard in SQL Management Studio to perform this task:
"Test connection failed because of an error initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user."
If the .mdb file is encrypted with user-level security then you need to provide the SQL Server import wizard with
the username and password to connect to the database, and
the location of the Workgroup Information file (.mdw)
In the SQL Server import wizard, click the "Advanced" button...
... and then on the "Connection" tab
un-check "Blank password"
check "Allow saving password"
enter the "User name" and "Password"
On the "All" tab, select the "Jet OLEDB:System database" property and click the "Edit Value..." button...
...then enter the full path to the associated .mdw file
After saving the changes you should be able to proceed with the import to SQL Server as usual.
I just removed the database password and that worked for me.

Change default db to Master db in SQL Server

I have deleted my default db now I can not login using sql server authentication. How can I change default db back to Master db
EDIT:
I cannot login using sql server authentication. It gives me error
Cannot open user default database.
Login failed. Login failed for user
'xyz'. (Microsoft SQL Server, Error:
4064)
Thanks.
Connect via SSMS. In the connection dialog box, click on the "Options >>" button and change the "Connect to database:" option to be Master instead of <default>.
This should get you in. Then you can use the command below to change your login's default DB.
Exec sp_defaultdb #loginame='login', #defdb='master'
In SSMS: Server->Security->General Tab->Default Database

Can't log in to SQL Server 2008 Management Studio

I think something happened to an mdf file on disk.
When I try to start SQL Server Mgmt Studio (SQL Server 2008, Win 7 x64), I get an error:
"Cannot open user default database."
Since I can't connect at all, how do I fix this?
I have tried connecting to other dbs using osql, but always get an error.
Thanks for any workarounds...
The easiest way to do this is via command line. You keep opening connections using SSMS that fail...
Using command line you'll have one connection and delimit the login name correctly: "[SVR\USR]"
sqlcmd -S InstanceName -d master -E -Q"ALTER LOGIN [SVR\USR] WITH DEFAULT_DATABASE = master"
or replace -E with -U SQLLogin -P Password if you have a SQL login handy
When connecting from Management studio, In the "connect to server" dialog box, before connecting, click "Options" and change the "Connect to database" dialog box to "master".
Login as an administrator and change your default database: ALTER LOGIN ... WITH DEFAULT_DATABASE = .... If you're not an administrator, ask an administrator to do it. If you must log in in the database in question, ask an administrator to investigate whi the database is offline.

Resources