pgadmin has no option to create server [duplicate] - pgadmin-4

I have a problem with postgresql, I want to connect my DB on RDS-Amazon but I don't find the option create server on PgAdmin 4.
I saw these tutorials:
https://adamtheautomator.com/rds-postgres/
But in my PGAdmin the situation is this:

Try Register, Server. That will call up a dialog box. Choose the connections tab to enter server address\name, user, db and password :

Related

Finding Connection Information for MS SQL Server

So I just downloaded Microsoft SQL Server 2019 (Developer) and the Server Management Software as well. I am trying to connect one of this new server's databases to an IntelliJ IDE Project, but I don't know where to find the connection information from.
Here is the IntelliJ DB connection page with the information
This is the information I need. I'm a CS student and took a 4000 level class before taking Design of Database systems. I'm sure I can make it work once I get the connection working, its just JSF and JDBC and SQLJ project.
So for anyone connecting a SQL Server for the first time to IntelliJ using Microsoft SQL Server Management and Microsoft SQL Server I will leave this:
Go to Windows search type Services
Navigate down to SQL Server Browser, right click Properties
Change startup type to automatic, under Service Status click Run
Go to MSSM, under Security enable Windows authentication and Server authentication
Go to SQL Server Configuration program from search
Make sure Server Browser is running, go to SQL Server Network Configuration (not 32-bit)
Click the arrow, go to Protocols for SQLEXPRESS (You may have a different name of SQLxxx if you downloaded another version than EXPRESS)
Enable TCP/IP by right-clicking enable
Right click and select properties
Under general, make sure Enabled is set to Yes, then go to Ip addresses. Scroll all the way down to IPAll
Set Dynamic Ports to blank, and TCP port to 1433. Restart your server.
In MSSM, under Security, create or change a login. SA is system admin, change the password if you want, or create another user by right clicking logins and adding if you want.
If you use sa, (I called it SA earlier I mean the same thing) make sure you right click go to properties status and make sure login is enabled. You can close out, and restart program, use Windows or Server authentication, if you want to use sa choose server authentication, then enter sa for user and whatever pass you made.
Now in intellij click the database pane. Choose a Microsoft SQL server, and the url by default is jdbc:sqlserver://localhost;instance=SQLEXPRESS. Enter your user credentials, Windows auth or server auth, and make sure you click the text at the bottom that says to download the drivers.
^Note, this will change if you didn't use SQLEXPRESS, change the name to your instance name in MSSM, right click the server and check properties instance name.
15. Choose your authentication type, I used SA.
To use DB with JDBC or SQLJ, JSF etc, import java.sql.*; and use the following lines
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://localhost;instance=SQLEXPRESS; databaseName = surveyData; user = sa; password = xxxxxx;";
Connection con = DriverManager.getConnection(connectionUrl);
Use your user and password, and databasename in the String connectionUrl. I think the drivers for JDBC:ODBC are installed already at this point, but if not, Google jdbc Microsoft SQL Drivers and download from official Microsoft site. It has various drivers for different Java Runtimes, so locate yours matching your Project SDK and add it to libraries. (the specific .jar in the folder)
The connection should work. If you want to test your connection make a main and type something like
if(con != null)
System.out.println("Connection successful");
Hope that can help someone in their coursework.

SQL Server Login Across LAN

I have an Access front-end on physical box A linked to a SQL Server instance in physical box A. When I launch the FE, it automatically connects to the SQL Server database with no issue. However, when I launch the same FE from networked physical box B, I get a "login timeout expired" error. I click "OK" which opens the generic SQL Server Login dialog, I click "OK" and I'm immediately connected. Any ideas? Thanks!
Well, first up, are you using sql logons, or windows logons?
I would on that 2nd machine re-link the tables. And you VERY much want to do make the connection with what we call a FILE dsn. If you do this, then if that instance of SQL server is open and allows incoming connections, then it should work.
So re-link the tables - in fact I recommend that you delete the table links. And AS stated you MUST use a FILE dsn - not machine/user. So, you can setup this link on the dev box that has both access + SQL server - but you REALLY need to use SQL server logons - not windows based logons.

Login to Microsoft SQL Server Error: 18456

I am getting this error while trying to connect to the SQL Server.
Microsoft SQL Server Error: 18456
Can anybody tell me what the error code means?
If you're trying to connect using "SQL Server Authentication" then you may want to modify your server authentication:
Within the Microsoft SQL Server Management Studio in the object explorer:
Right click on the server and click Properties
Go to the Security page
Under Server authentication choose the SQL Server and Windows Authentication mode radio button
Click OK
Restart SQL Services
Check out this MSDN blog article from the data platform team.
You really need to look at the state part of the error message to find the root cause of the issue.
2, 5 = Invalid userid
6 = Attempt to use a Windows login name with SQL Authentication
7 = Login disabled and password mismatch
8 = Password mismatch
9 = Invalid password
11, 12 = Valid login but server access failure
13 = SQL Server service paused
18 = Change password required
Afterwards, Google how to fix the issue.
Before opening, right-click and choose 'Run as Administrator'. This solved the problem for me.
I have faced this issue.
Please look at the attached image,
Step 1: Go to server property
Step 2: Go to Security
Step 3: Change server authentication as SQL server and WindowsAuthenication mode
and restart your Sql server.
first see the details of the error
if "state" is "1"
Ensure the database is set for both SQL and Windows authentication under SQL server / Properties / Security.
for other state see the above answers ....
Just an update, here is the solution if anyone else has there error with a properly configured login:
If you're trying to connect using "SQL Server Authentication" then you may want to modify your server authentication:
Within the Microsoft SQL Server Management Studio in the object explorer:
Right click on the server and click Properties
Go to the Security page
Under Server authentication choose the SQL Server and Windows Authentication mode radio button
Click OK
Restart SQL Services
Check whether mixed mode authentication is enabled in you server->properties
Then create a login in the server->security
create an user for that login in your database
Then restart your server by right clicking the instance and select restart
If you change a login user credential or add new login user then after you need to log in then you will have to restart the SQL Server Service. for that
GO to--> Services
Then go to SQL Server(MSSQLSERVER) and stop and start again
Now try to log in, I hope You can.
Thanks
Just happened to me, and turned out to be different than all other cases listed here.
I happen to have two virtual servers hosted in the same cluster, each with it own IP address. The host configured one of the servers to be the SQL Server, and the other to be the Web server. However, SQL Server is installed and running on both. The host forgot to mention which of the servers is the SQL and which is the Web, so I just assumed the first is Web, second is SQL.
When I connected to the (what I thought is) SQL Server and tried to connect via SSMS, choosing Windows Authentication, I got the error mentioned in this question. After pulling lots of hairs, I went over all the setting, including SQL Server Network Configuration, Protocols for MSSQLSERVER:
Double clicking the TCP/IP gave me this:
The IP address was of the other virtual server! This finally made me realize I simply confused between the servers, and all worked well on the second server.
Right Click the User, go to properties, change the default database to master
This is the screen print of the image which shows what you have to check if you have the error 19456. Sometimes it default to a database which the user doesn't have permission
18456 Error State List
ERROR STATE ERROR DESCRIPTION
State 2 and State 5 Invalid userid
State 6 Attempt to use a Windows login name with SQL Authentication
State 7 Login disabled and password mismatch
State 8 Password mismatch
State 9 Invalid password
State 11 and State 12 Valid login but server access failure
State 13 SQL Server service paused
State 18 Change password required
Potential causes
Below is a list of reasons and some brief explanation what to do:
SQL Authentication not enabled: If you use SQL Login for the first time on SQL Server instance than very often error 18456 occurs because server might be set in Windows Authentication mode (only).
How to fix? Check this SQL Server and Windows Authentication Mode page.
Invalid userID: SQL Server is not able to find the specified UserID on the server you are trying to get. The most common cause is that this userID hasn’t been granted access on the server but this could be also a simple typo or you accidentally are trying to connect to different server (Typical if you use more than one server)
Invalid password: Wrong password or just a typo. Remember that this username can have different passwords on different servers.
less common errors: The userID might be disabled on the server. Windows login was provided for SQL Authentication (change to Windows Authentication. If you use SSMS you might have to run as different user to use this option). Password might have expired and probably several other reasons…. If you know of any other ones let me know.
18456 state 1 explanations: Usually Microsoft SQL Server will give you error state 1 which actually does not mean anything apart from that you have 18456 error. State 1 is used to hide actual state in order to protect the system, which to me makes sense. Below is a list with all different states and for more information about retrieving accurate states visit Understanding "login failed" (Error 18456) error messages in SQL Server 2005
Hope that helps
Also you can just login with windows authentication and run the following query to enable it:
ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;
GO
Source: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/change-server-authentication-mode
First go to start bar then search local services
Then click on "view local services"
Then it will open service window then go to SQL Server(MSSQLSERVER) right click on it and click on stop and then again right click on it and click start. Now you can able to login and put your user name as 'sa' and password is your won password.
Please check to see if you are connected to the network if this is a domain member PC. Also, make sure you are not on a dual home PC as your routes may be incorrect due to network metrics. I had this issue when I could not connect to the domain the SQL windows authentication switched to the local PC account but registered it as a SQL authentication. Once I disabled my wireless adapter and rebooted, the Windows integration switched back to the domain account and authenticated fine. I had already set up Mixed mode as you had already done as well so the previous posts do not apply.
For me, it was wrong login and password.
I believe this can happen if you are trying to log in with a user that is defined in Active Directory, but attempt using "SQL Server Authentication" in the login screen. I do not know how to specify a different user with NTLM/Windows Authentication: When I click the Windows Authentication dropdown, the username and password is blanked out, and I can only log in as myself.
In my case multiple wrong attempts locked the account.To do that I had tried running the below query and it worked:
ALTER LOGIN WITH PASSWORD= UNLOCK
And make sure to set the option "Enforce Password Security" option for specific user to be unchecked by right click on Sql Server -> Properties.
SQL Server connection troubleshoot
In case you are not able to connect with SQL Authentication and you've tried the other solutions.
You may try the following:
Check connectivity
Disable Firewall.
Run PortQry on 1434 and check the answer.
Check the state
Try to connect with SSMS or sqlcmd and check the message.
State 1 is rarely documented but it just mean you don't have the right to know the true state.
Look at the log file in the directory of SQL server to know what is the state.
The State 5
What ? my login doesn't exist ? it's right there, I can see it in SSMS. How can it be ?
The most likely explanation is the most likely to be the right one.
The state of the login
Destroy, recreate it, enable it.
reset the password.
Or...
"You don't look at the right place" or "what you see is not what you think".
The Local DB and SQLEXPRESS conflict
If you connect with SSMS with Windows authentication, and your instance is named SQLEXPRESS, you are probably looking at the LocalDb and not the right server. So you just created your login on LocalDb.
When you connect through SQL Server authentication with SSMS, it will try to connect to SQLEXPRESS real server where your beloved login doesn't exist yet.
Additional note: Check in the connection parameters tab if you've not forgotten some strange connection string there.
Another worked solution for me.
serever->security->logins->new logins->General->create your user name as login name,Click sql server authentication add passwords
uncheck the password verification three checkboxes .
This will work.
Remeber to change the server properties ->Security from Server authentication to SQL Server and Windows Authentication mode
you can do in linux for mssql
change password for sa account
sudo /opt/mssql/bin/mssql-conf setup
The license terms for this product can be downloaded from
http://go.microsoft.com/fwlink/?LinkId=746388 Jump Jump
and found in /usr/share/doc/mssql-server/LICENSE.TXT.
Do you accept the license terms? [Yes/No]:yes
Setting up Microsoft SQL Server
Enter the new SQL Server system administrator password: --Enter strong password
Confirm the new SQL Server system administrator password: --Enter strong password
starting Microsoft SQL Server...
Enabling Microsoft SQL Server to run at boot...
Setup completed successfully.
I got this error after creating a new sysadmin user under my SQL instance.
My admin user was created under a specific domain
MyOrganization/useradmin
Using useradmin on a disconnected environment allows you to create other users using SQL Server authentication, but as soon as you try to login you get
Microsoft SQL Server Error: 18456
To fix the problem, try to connect again to your Organization network and create the user while you are connected and then you can get disconnected and will work.
I have faced the same issue. In case you see it, run this query:
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS
then it shows a 18456 error code.
Do one thing again run same query after reconnecting SQL server. It will work fine.
Click on "Options" and under "Connection Properties" specify the catalog/database name next to "Connect to database:". I got the error because this was set to <default> and I needed to specify the dbname.
Microsoft SQL Server, Error: 18456
I was getting an issue because I was entering the wrong password.
Microsoft SQL Server, Error code: 18456 - This indicates that the password is incorrect.
Reference: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error?view=sql-server-ver16
it happen with me when I have restored my computer
enable windows and sql authentication
reboot your PC
in vs code in my case still in error because i forget install pyodbc :D

SSIS - how to make a connection string for your database server?

How do i make a connection string for my database server ? I want to know this so that i can save connection strings in a table and then use them later. Note - All my database servers don't need password and username. I login to a remote "mother" server and access the other remote servers in management studio using 'windows authentication'. So, i don't think my connection string needs to have a user name and password.
Assuming this is for SSIS, create a connection manager, then poke around in it's properties - you'll find the connection string. Take a look here for examples:
http://www.connectionstrings.com/
When connecting to an MS SQL database you require to log in using an account. I am assuming that the windows account you use to connect to the remote server is also the account that is used to log into server is the same account that is used to log into the server. So you can set a connection manager using the same window authentication.
To set up a new connection from BIDS open the solution manager window, then one right hand mouse click on 'Connection Managers' and left hand mouse click on 'New Connection Manager'
The 'Add SSIS Connection Manager' window will appear, this example l have selected and OLE DB connection, next click on the 'Add..' button.
The next screen may already have connections defined as the screenshot shows. Press the 'New..' button to add another data connection.
This final screen is where you provide the details of the database you wish to connect to. The combo box titled 'Server name' when you click on the down arrrow, may contain the server\database instance you want to create a connection for. Otherwise you can enter it manually by typing it directly in the the box. The syntax is as follows [database server name][MS Sql server instance name] eg Yoda\LukeDB. Where 'Yoda' is the name of the server and 'LukeDB' is the name of the database instance you want to connect to. In the screenshot the 'Log on to the server' is set to 'Use Windows Authentication'. However this assumes the windows account on you access the remote server with is the same as the machine running the SSIS package. Once you have entered all the details, press 'Test Connection' to check if a connection can be made successfully.
From a security point of view it would be recommended to set up a SQL account on the database instance which the SSIS package is run against. Then configure that SQL account just the permissions it requires to run the SSIS package.

cannot connect to pc-name\SQLEXPRESS

While trying to connect to SQL Server 2005 Standard Edition through SQL Server Management Studio 2005 I get the following error:
I put all my effort to solve this problem but there is no solution. On stack overflow in the following post I found this screen shot:
When I see my connect to server dialog box I find the difference like
What is the problem?
This SQL server runs on a single machine, not on a cluster or on a client server.
Go to services (services.msc) and restart the services in the image and then try to connect.
If you have Microsoft Windows 10:
Type Control Panel on Cortana search bar (which is says by default 'Type here to search').
Or click on Windows icon and type Control Panel
Click on Administrative Tools
Then double click on Services
Scroll down and look for: SQL Server (SQLEXPRESS), after that right click
And then in the pop out windows click on Start
Now you should be able to connect to your pc-name\SQLEXPRESS
When you get this error.
Follow these steps then you solve your problem
Open command prompt by pressing (window + r) keys or Click on windows Button and Type Run then type services.msc and click OK or press Enter key.
2.Find SQL Server (SQLEXPRESS).
3.Now see left upper side and click start.
4.If Service show error then right click on SQL Express and then click on Properties.
5.Then click on Logon Tab.
6.Enter Username and Password of Windows Authentication
7.Then Start your Service
8.Problem will be solve and run your query
Use (LocalDB)\MSSQLLocalDB as the server name
Follow these steps then you solve your problem 100%.
When you get this error then close everything(Microsoft SQL Server Managment):
Then open command prompt by pressing (window + r) keys and type services.msc and click OK or press Enter key.
And search **SQL Server (SQLEXPRESS) as I show in the image.
Now see left upper side and click start.
If you open Microsoft SQL Server Management then you not get any type error.
Enjoy!!!
I'm Running Windows 10 and this worked for me:
Open services by searching in the toolbar for Services.
Right click SQL Server (SQLEXPESS)
Go To Properties - Log On
Check Local System Account & Allow service to interact with desktop.
Apply and restart service.
I was then able to connect
Initialize the SQL Server Browser Service.
try using IP instead of pc name. If the ip working, then it might be the name pipe is not enable. If it;s still not working then the login using windows might be disabled.
I had this problem.
So I put like this:
PC-NAME\SQLSERVER
Since the SQLSERVER the instance name that was set at installation.
Authentication: Windows Authentication
Connects !!!
go to services and start the ones related to SQL
My issue occurs when I add a PC to a domain. Restarting the service, making sure it's running, that it has the correct credentials to run, etc, as in other answers doesn't work. I don't know exactly what the problem is, but I can't even log in with the local user anymore to give the domain user access. Here's the steps that work for me:
In SSMS
View > Registered Servers
Database Engine > Local Server Groups > right-click pcname\sqlexpress
Delete > Yes
Right-click Local Server Groups > Tasks > Register Local Servers
It confirms that it re-registered. pcname\sqlexpress reappears.
I'm then able to log in with the local windows auth'd user again, my databases are all there and everything. I then go about my business adding the domain user to Security > Logins.
In my case, I was copying and pasting the server name from appsettings.json as;
DESKTOP-IVQP9DJ\\SQLEXPRESS.
So the problem was that there were two slashes in the server name which was causing the issue for me.
If you are using .net core and copying/pasting server name like me make sure to use only one slash as:
DESKTOP-IVQP9DJ\SQLEXPRESS
If you already did that
Then just restart the service :
start menu
Microsoft SQL Server 20xx
Sql Server 20xx Configuration Manager
SQL Server Service (at left tree)
SQL Server (SQLEXPRESS) (at right region)
right click -> restart

Resources