SQL Server 2008 connecting error - sql-server-2008

After installation of SQL Server 2008, I open SQL Server 2008 and in Connect to Server window, I set following information :
Server type: Database Engine
Server name: MATRIX-PC\SQLEXPRESS
Authentication: Windows Authentication
User name: MATRIX-PC\MATRIX
Password:
Note: my PC name is MATRIX
I also in above information Server name changed to .\sqlexpress, but it returns an error when click on connect button:
Cannot connect to MATRIX-PC\SQLEXPRESS
Additional Information
A network-related or instance-specific error occured 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. (provide: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Related

MySQL Workbench Migration from MSSQL: Windows Authentication with AzureAD

TL;DR: Having trouble identifying the correct server, username, and password combination to connect MySQL to an existing MSSQL database using Windows Authentication. Will I need to create a separate user for the migration, or is it possible to connect to MySQL in the Migration Wizard using MSSQL Windows Authentication?
Background and Debugging Steps
I received a BAK file which I would like to import into my existing MySQL installation. I have successfully imported the BAK file into Microsoft SQL Server Management Studio 18 (MSSQL). I am now trying to migrate the database to MySQL using the Database Migration Wizard in MySQL Workbench 8.0.27.
I believe the issue I am running into relates to authentication. In MSSQL I am connecting to the server using Windows Authentication. My User name is "AzureAD\ZachLonghofer" and MSSQL takes care of the password. In the MySQL migration wizard, using the default connection method, I receive this message log:
Starting...
Connect to source DBMS...
- Connecting to source...
Connecting to Mssql#MS Access Database...
Opening ODBC connection to DSN=MS Access Database;DATABASE=;UID=AzureAD\ZachLonghofer;PWD=XXXX...
ERROR: Connection failed: No open connection to Mssql#MS Access Database
Connecting to Mssql#MS Access Database...
Opening ODBC connection to DSN=MS Access Database;DATABASE=;UID=AzureAD\ZachLonghofer;PWD=XXXX...
ERROR: Connection failed: No open connection to Mssql#MS Access Database
Traceback (most recent call last):
File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\wizard_progress_page_widget.py", line 71, in run
self.func()
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_source_selection.py", line 455, in task_connect
raise e
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_source_selection.py", line 439, in task_connect
if not self.main.plan.migrationSource.connect():
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration.py", line 199, in connect
self._rev_eng_module.connect(self.connection, self.password or "")
SystemError: NotConnectedError("No open connection to Mssql#MS Access Database"): error calling Python module function DbMssqlRE.connect
ERROR: Error during Connect to source DBMS: NotConnectedError("No open connection to Mssql#MS Access Database"): error calling Python module function DbMssqlRE.connect
ERROR: Exception in task 'Connect to source DBMS': SystemError('NotConnectedError("No open connection to Mssql#MS Access Database"): error calling Python module function DbMssqlRE.connect')
Failed
I also tried using ODBC (native) and specifying the Server: ZLONGHOFER\SQLEXPRESS01 -- which is what shows as the server in MSSQL. With this configuration, I receive this message log, which is identical until after the traceback:
Starting...
Connect to source DBMS...
- Connecting to source...
Connecting to Mssql#DRIVER=SQL Server;SERVER=ZLONGHOFER\SQLEXPRESS01...
Opening ODBC connection to DRIVER={SQL Server};SERVER=ZLONGHOFER\SQLEXPRESS01;DATABASE={};UID=AzureAD\ZachLonghofer;PWD=XXXX;...
Connecting to Mssql#DRIVER=SQL Server;SERVER=ZLONGHOFER\SQLEXPRESS01...
Opening ODBC connection to DRIVER={SQL Server};SERVER=ZLONGHOFER\SQLEXPRESS01;DATABASE={};UID=AzureAD\ZachLonghofer;PWD=XXXX;...
Connecting to Mssql#DRIVER=SQL Server;SERVER=ZLONGHOFER\SQLEXPRESS01...
Opening ODBC connection to DRIVER={SQL Server};SERVER=ZLONGHOFER\SQLEXPRESS01;DATABASE={};UID=AzureAD\ZachLonghofer;PWD=XXXX;...
Traceback (most recent call last):
File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\wizard_progress_page_widget.py", line 71, in run
self.func()
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_source_selection.py", line 455, in task_connect
raise e
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_source_selection.py", line 439, in task_connect
if not self.main.plan.migrationSource.connect():
File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration.py", line 199, in connect
self._rev_eng_module.connect(self.connection, self.password or "")
grt.DBLoginError: [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\ZachLonghofer'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\ZachLonghofer'. (18456)
ERROR: Error during Connect to source DBMS: [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\ZachLonghofer'. (18456) (SQLDriverConnect);
[28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\ZachLonghofer'. (18456)
ERROR: Exception in task 'Connect to source DBMS': DBLoginError("[28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\\ZachLonghofer'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'AzureAD\\ZachLonghofer'. (18456)")
Failed
Windows Authentication
The password I am using is my windows user password. I'm fairly certain I've never set a password for MSSQL: I've only ever used Windows Authentication and I thought the username and password would parallel my Windows Login and Password, but it seems not.
It also occurs to me that I may need to create a user in MSSQL if it may not be possible to import to MySQL using Windows Authentication connection to MSSQL. If so, I will need to [figure out how to] create a separate user in MSSQL to do the migration.
Will I need to create a separate user for the migration, or is it possible to connect to MySQL in the Migration Wizard using MSSQL Windows Authentication?
TL;DR;
When you log in on a Windows machine you use Windows Authentication. The user logged in is the same one used by the SSMS, this one doesn't take care of your password simply because it doesn't need you are already authenticated to Windows, and this "mechanism" is the same for every program you use.
Your question omitted the most important "piece": the connection string or at least the code/library you use to connect to MsSQL Server.
Microsoft SQL Server (on premises) can run in two mode:
Integrated authentication only
Mixed mode -> Integrated authentication AND Sql Server authentication
On mode 1 you can only login to SQL Server using Windows Authentication only whenever on mode 1 you can use Windows Auth and users created directly on SQL Server.
From the log I see
Opening ODBC connection to DRIVER={SQL Server};SERVER=ZLONGHOFER\SQLEXPRESS01;DATABASE={};UID=AzureAD\ZachLonghofer;PWD=XXXX;
UID and PWD are symptoms using a Sql Server Authentication NOT Windows Authentication.
TODO
If you want to use Windows Authentication you must remove user and password from your connection string and add Integrated Security=true; this specify to use the Win Auth see here for connection strings
If you want to use a SQL Server User, you must create a user and assign at least the reader of the DB and then use the username and password, here a tutorial on how to

lost connection to mysql server at reading initial communication packet, system error:34 in sqlyog

I am using the server
AWS linux
ID_LIKE="centos rhel fedora"
DB
Server version: 10.4.17-MariaDB MariaDB Server
I want to use a sql tool which is sqlyog using putty with this sql server
But when i try to connect the server
it says lost connection to mysql server at reading initial communication packet, system error
sqlyog connection image
error message
server ip:port number(33)
server ip:3306(sql port) i've tried this too
Could anybody helps what's wrong ?

[MySQL][ODBC 5.3(a) Driver]Can't connect to MySQL server

I have difficulty connecting to MySQL server from Tableau Server.
The error message is:
[MySQL][ODBC 5.3(a) Driver]
Can't connect to MySQL server on XYZ.
Unable to connect to the MySQL server "xyz".
Check that the server is running and that you have access privileges to the requested database
I have installed MySQL ODBC 5.3 Driver from tarball distribution in Ubuntu OS, and whitelisted the IP address of Tableau server in MySQL server.
What could be the possible causes for this? And is there any way that I check the ODBC connector was properly installed?
Any suggestion/comments are much appreciated!
Reasons, you could not connect could be different. But the error you've get asks you to check if server is running. It means, it could not find server.
The reasons, it could not find server, could be:
Server is down (Check its status by systemctl status mysql)
Server is not listening on some port your app connects to
Server is behind firewall (sudo ufw allow mysql command execution required to solve it in this case)
Your user does not have permissions to access that database, as it states in the error

SQLCMD utility : connection to second instance does not work

I have only SQLCMD utility installed locally and want connect to MSSQL instance, but it seems the tool cannot parse the instance name
example:
sqlcmd -S SERVER\INSTANCE -U sa -P password
However, I can use this command from the machine where SQL Server is already installed.
Error message:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]..
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
To use SQLCMD to connect to a remote server instance use the full URI of your server over the network like so;
sqlcmd -S FULLSERVERURI\INSTANCE -U sa -P password
for example, if you had your server at 'someplace.com', your connection would be
sqlcmd -S someplace.com\INSTANCE -U sa -P password
The machine/server would need to have port 1433 open. Consider your network security options.
Please make sure you enable TCP/IP Protocol. This is different from allowing network connections in the server properties.
This is a MSSQL 2012 example, but I have it tested on MSSQL 2017 Developer (full) and still works the same (and also, fails just the same when disabled)

Conn to Google Cloud SQL instance from CORE w/ proxy: A network-related or instance-specific error occurred. I CAN connect via mysql cmd

I begin by starting goole sql proxy by running following command:
./cloud_sql_proxy -instances=dauntless-gate-xxxxxx:us-central1:redacted-dev=tcp:3306
I SUCCESSFULLY connect from to it from running the following commands:
mysql --host=127.0.0.1 --user=sa --password=<redacted>
or
mysql --host=127.0.0.1 --user=sa --password=<redacted>
I attempt and fail to connect using ASP.net Core 2 w/ the follwing:
startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<UserContext>(opt =>
opt.UseSqlServer("Server=127.0.0.1:3306; User Id=sa;Password=<redacted>;"));
...
}
Error:
SqlException: 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: TCP Provider, error: 35 - An internal exception was caught)
I also try with the following and get slightly different error:
startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<UserContext>(opt =>
opt.UseSqlServer("Server=127.0.0.1; User Id=sa;Password=<redacted>;"));
...
}
An unhandled exception occurred while processing the request.
SqlException: 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: TCP Provider, error: 40 - Could not open a connection to SQL Server)
An unhandled exception occurred while processing the request.
ExtendedSocketException: No such device or address
System.Net.Dns.InternalGetHostByName(string hostName)
"SQL Server" is the name for Microsoft's SQL server product, which is not the same as MySQL, which running on your instance. You will need to use the MySQL Connector/NET to connect. Check out this page for more specific guidance for Entity Framework.