2016-07-19 2 views
0
내가 asp.net의 웹 서비스를 통해 MySQL 데이터베이스에 연결하려고

그러나 그것은 나에게이 오류MySQL은 SQL Server에 대한 연결을 열 수 없습니다

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 the SQL server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 

내가 MySQL 데이터베이스를 사용하고 있습니다 내 연결 문자열은

"Data Source=localhost;Initial Catalog=test;User Id=root;Password=;Integrated Security=True" 

내가 지금까지 본 모든 솔루션은 MS SQL 용입니다. 미리 감사드립니다

+0

mysql이 실행되고 있습니까? – Iceman

+0

네, C : \ xampp \ mysql \ bin> mysqladmin ping을 시도해 보았고 다음과 같이 작성했습니다 : mysqld is 살아 @Iceman – lulliezy

+0

여기에서 guy : http://stackoverflow.com/questions/16256533/a-network-related-or -instance-specific-error-a-establish-a-conne가 발생했을 때 –

답변

0

조금 바빴지만 앉아서 실제로 작업하기로 결심했습니다. 어떻게 해결했는지, MySQL 데이터에 대한 참조를 추가했습니다. (물론 .net 커넥터를 설치 한 후) MySql.Data.MySqlClient 대신 System.Data.SqlClient 및 기타 모든 항목 가져 오기 SqlConnection 대신 MySqlConnection 및 voila로 변경된 MySQL은 매력처럼 작동했습니다.

관련 문제