cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beckett Frequent Visitor
Frequent Visitor

Can't connect to SQL server

Hi, I'm trying to connect to an external SQL server using Power BI desktop but I'm getting an error:

 

Details: "Microsoft SQL: 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)"

 

I suspect this may be because the IP address Power BI is using to connect is not whitelisted on the server, does anyone know what IP I would need to whitelist to get this to work, or have any other suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: Can't connect to SQL server

@beckett,

Are you able to connect to SQL Server from SQL Server Management Studio(SSMS)? Ensure that SSMS is installed on the same machine with Power BI Desktop.

Besides, please follow the instructions in the article below to troubleshoot this connection error.
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-th...

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Chihiro Established Member
Established Member

Re: Can't connect to SQL server

If you are able to normally connect to SQL server using connector (outside of Power BI). You should be able to connect from PowerBI without issue.

 

Try checking your connection syntax and spelling. Also 

Ex: Server = ServerName: Port#, Database = dbname

If this isn't isolated to PowerBI... then check following list for what may cause Named Pipes Provider, error: 40.

 

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2a8f2e64-74cf-46f2-b2be-bbb08b1502cb/re-nam...

GeorgeK-VL Regular Visitor
Regular Visitor

Re: Can't connect to SQL server

Hello @beckett

 

I had some issues with connecting to MySQL databases in the past, and the solution I found was to use the 32bit version of PowerBI. 

I don't know what the version had to the with the issue but it worked. I was receiving the exact same error as you.

 

Regards

George

 

Moderator v-yuezhe-msft
Moderator

Re: Can't connect to SQL server

@beckett,

Are you able to connect to SQL Server from SQL Server Management Studio(SSMS)? Ensure that SSMS is installed on the same machine with Power BI Desktop.

Besides, please follow the instructions in the article below to troubleshoot this connection error.
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-th...

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

beckett Frequent Visitor
Frequent Visitor

Re: Can't connect to SQL server

Turned out it was to do with whitelisting the IP, but I was going up a blind alley thinking the request originated from a Power BI server somewhere - actually my own IP wasn't whitelisted! Thanks for the advice everyone.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 43 members 919 guests
Please welcome our newest community members: