Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006

    Unanswered: MySQL Connection String


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

    I am using 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=(;Initial Catalog=testdb;User ID=test;Password=testpass");

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

    SqlConnection myConnection = new SqlConnection("server=(\\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,

  2. #2
    Join Date
    Jul 2004
    Dundee, Scotland
    we normally install mysql on our computer using "localhost" ( 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts