Reputation: 3100
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:
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.
Upvotes: 2
Views: 17266
Reputation: 1
Follow the steps:
In Visual Studio Code:
Upvotes: 0
Reputation: 859
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>'
Upvotes: 0
Reputation: 2939
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.
Upvotes: 2