If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL Connection String

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-06-06, 09:51
trent101 trent101 is offline
Registered User
 
Join Date: Aug 2006
Posts: 6
MySQL Connection String

Hey,

I know this should be simple but for the life of me I cannot connect to my mysql db.

I am using asp.net with c# code, I have tried the following strings, and they compile fine but when executing the page i get a

"System.Data.SqlClient.SqlException: SQL Server does not exist or access denied."

It points to the line "myConnection.Open();"

The connection strings i supplied are:

SqlConnection myConnection = new SqlConnection("Data Source=(202.174.100.40);Initial Catalog=testdb;User ID=test;Password=testpass");

SqlConnection myConnection = new SqlConnection("Data Source=(202.174.100.40);Database=testdb;User ID=test;Password=testpass;Trusted_Connection=yes") ;

SqlConnection myConnection = new SqlConnection("server=(202.174.100.40)\\NetSDK;dat abase=testdb;Trusted_Connection=yes");


Does anyone know what I am doing wrong? I was given the IP address by my ISP, they have assured me its correct.

Thanks for your time in reading this,
Reply With Quote
  #2 (permalink)  
Old 08-06-06, 14:59
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
we normally install mysql on our computer using "localhost" (127.0.0.1). Is this not the case with your installation?

you're ISP might well have given you a static IP address as opposed to a dynamically allocate one. if using Windows you can check your IP address in a DOS window by typing "ipconfig".

I use php with mysql. sorry I can't be of more help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On