Connection to SQL Server 2008: error 18452 - sql-server-2008

I have a problem with connection to SQL Server 2008.
My problem is all simple user can't connect to SQL Server 2008 but just the admin in subdomain only who can connected.
I test the connection with these steps:
control panel / set up odbc
system DNS / I choose SQL Server
click on the bottom Add
in the Name=test, and the server = I choose SQLSERVER
When I clicked Next bottom I have error 18452.
Connection failed: SQLState: '28000'
SQL Server Error: 18452
[Microsoft][ODBC SQL Server Driver][SQL Server] connection failed.

SQL Server Error: 18452
Login failed for user ". The user is not associated with a trusted SQL
Server connection.
You should create new DSN with changed Authentication Mode from Windows Authentication Mode to SQL Server Authentication. Then specify login and pass for connection. This login should be added on SQL too.

I were trying to do the same, saw a lot of videos trying to accomplish the add of the DSN but this was my solution.
I'm running Windows Server 2016:
I ran the ODBC 64bit -> System DSN tab -> Add button
Then I selected SQL Server, since i had SQL Server Management Studio 17.
I putted a Name and the fact that is really important: Write the SQL Server you know you have connection to on the Server field.
Be sure you had configured the Security on Server authentication for SQL Server and Windows Authentication mode and then write the user you know that have access to that Data Base.
Last step: you click next after putting the info of the user that have acces to the SQL Server and the connection will pass.
Hope this help someone.

Related

Visual Studio Code mssql extention: SQL Server (mssql) - Unable to connect to server

I'm trying for the first time to get my project to run in Visual Studio Code. This includes a MySQL database. So I've installed the SQL Server (mssql) extension version 1.7.1. I follow the instructions here: https://learn.microsoft.com/en-us/sql/visual-studio-code/sql-server-develop-use-vscode?view=sql-server-ver15
I get to the section "Connect to SQL Server" and enter:
servername: localhost
db name: c3
Authentication type: Integrated
At the end of the section it should connect with the server but instead I get two errors:
mssql: Error "Unable to connect using the connection information
provided. Retry profile creation?"
mssql: Error 2: A network-related or instance-specific error occurred
while establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name is correct
and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)
Does anyone see what is going wrong here?
I've re-installed the extension but with the same result.
A MySQL db and Microsoft SQL Server db are two different things.
It seems that there's no SQL Server installed? You might install the free SQL Server Express Version, create the database in there and then connect from Visual Studio Code.
You have to install the database server yourself as VS Code is just a client. You might also use somekind of hosted offers (many webhosters offer a mysql server with self service installation, or use a cloud based database server). Yout can also use a local database (e.g. SqlLite) which is file based and doesn't need a special installation.
You should do the following
install SQL server in your machine and create Database here
Create a login and a database user here
If you are Using VS code install SQL Server (mssql) open new
connection, follow the prompts to specify the properties for the new
connection profile
If you want to login to your server to make sure of your data
sqlcmd -S localhost -U SA -P '<YourPassword>'

Connect to sql server with management studio

I have a sql server hosted on go daddy that I simply am unable to connect to using Visual Web Developer 2010 Express or Microsoft SQL Server Management Studio.
Cannot connect to RBSAssetTracker.db.2574383.hostedresource.com.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 67)
Am I missing something? This seems like it should be relatively simple to accomplish this.
first check whether you can ping the database server then check following
Step 1) Make sure SQL SERVER is up and the instance you try to connect is running.
Step 2) Your system Firewall should not block SQL Server port.
Step 3) Go to Computer Management >> Service and Application >> SQL Server 2005 Configuration >> Network Configuration
Enable TCP/IP protocol. Make sure that SQL SERVER port is by Default 1433.
Step 4) Now follow this KB Article of MSDN depending on your server : http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
open your godaddy account,
click launch under your webhosting menu,
click on SQL server database
click actions-->details and watch for the 'hostname'
it will be like : databasename.db.99999999.hostedresource.com
copy and paste that thing to 'Server name' while logging to your management studio
Enter your godaddy sql-server database username and password to login in management studio. It should work right.

Can't connect to local SQL Server

I'm trying to call a sproc from EntLib (MVC3, EntLib5, SQL Server 2008). I'm using the default instance of SQL Server and can connect to it just fine from SQL Server Management Studio. I've tried everything I could find online and nothing gets me connected. The service is running as LocalSystem. Here's the connecction string:
Server=local;Database=Test;Trusted_Connection=True
Here's the error message I'm getting:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Server should be "localhost", not "local", and the "TCP/IP" and "Named Pipes" protocols should be enabled in SQL Server Configuration Manager. Also, if you want to use a trusted connection, you might need to enable Windows Authentication on your MVC3 application, otherwise provide a username and password in the connection string as well.
If you are working with your local SQL Server you need to use localhost or "."

SQL mangement user error

When i am creating users in SQL management studio i create them under the server name and then i create them under the database but when i try to log on using the user name and password i cant. getting erro saying
> TITLE: Connect to Server
Cannot connect to LAPTOP-RED\SQLEXPRESS.
ADDITIONAL INFORMATION:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476
BUTTONS:
OK
And the suggested solution from the help link is:
User Action
Use the SQL Server Surface Area Configuration tool to allow SQL Server
to accept remote connections. For more information about the SQL
Server Surface Area Configuration Tool, see Surface Area Configuration
for Services and Connections.
Which is what you have to do. By default the SQL Express Server isn't configured to allow remote connections.
hi I faced same issue in MicroSoft sql server 2008.
this error occurs while user limit exceeded, as you have set max connection to 1 and if someone is already logged in (or using any webpage which access your server) then it will not allow anyone to access directly or indirectly. to solve this issue simply follow following steps:
stop all web services.
open services.msc using RUN and ****restart sql server** and do not start any service which uses your sql server, so that you will be able to log in using sql server management studio.
now open sql server management studio and click on New Query button.
It will ask for user name and password use your login name and password.
run these scripts one by one sp_configure 'user connections', 0
go
6.reconfigure with override
after this restart your sql server it will show a confirmation message click on OK.
Bingo
It works. please don't forgot to vote ;-)

Accessing SQL Server 2008 R2 Express with SQL Server Management Studio

OK maybe I'm being stupid somehow, and my googleing has not found a clear step by step user case for beginners.
I have just installed into my Win 7 Pro 64-bit SP1 machine SQL Server 2008 R2 Express Database with Advanced Services [downloaded from here http://www.microsoft.com/express/Database/InstallOptions.aspx]. (Actually I have removed and installed it 3 times now to check I'm not missing anything config wise). I have left basically all settings as default, with the exception of calling the Instance SQLEXPRESS (all caps vs default SQLexpress) my last installation I have left set as 'windows authentication mode' with only the same user as I am running now selected (only one user on this machine anyway).
After completion I have restarted the machine, I can see the services
SQL Server (SQLEXPRESS) -> Started -> Automatic
SQL Server Agent (SQLEXPRESS) -> -> Manual
SQL Server Browser -> -> Manual
SQL Server Reporting Service (SQLEXPRESS) -> Started -> Automatic
SQL Server VSS Writer -> Started -> Automatic
.. So it seems to be up OK.
As part of the installation process it also installed SQL Server Management Studio 2008 R2 and when I try and connect I am choosing:
Server: Database Engine
Servername : \SQLEXPRESS
Authentication: Windows Authentication
User name: (selected for me and not alterable) machinename\username
Password: (also blank greyed out)
I hit connect and get the following message.
Cannot connect to \SQLEXPRESS.
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: SQL Network
Interfaces, error: 25 - Connection
string is not valid) (.Net SqlClient
Data Provider)
Error Number: 87
Severity: 20
State: 0
OK, so given I am not entering a username or password, and I'm certain of the server instance name - and that it is running ... what am I doing wrong?
Here are a few troubleshooting tips for connecting to SQL Server via SSMS:
Ensure you're connecting to .\sqlexpress or localhost\sqlexpress, or (local)\sqlexpress. It's not case sensitive. It appears you're missing the hostname in the server name field in the connection dialog.
You're using Windows/AD authentication, so you don't have to enter any credentials. It appears you're all set there.