Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MySQL Connection

MySQL Connection

Scheduled Pinned Locked Moved C#
sysadminmysqlsecurityhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gareth H
    wrote on last edited by
    #1

    Hi, Im trying to connect to a mysql server, the connection detials are below: ("Network Address=ip:3306" + "Initial Catalog='db1';" + "Persist Security Info=no;" + "User Name='login';" + "Password='pass'"); The problem is it complains that the first piece of the string isnt correcty formed. Any ideas? Regards, Gareth.

    W 1 Reply Last reply
    0
    • G Gareth H

      Hi, Im trying to connect to a mysql server, the connection detials are below: ("Network Address=ip:3306" + "Initial Catalog='db1';" + "Persist Security Info=no;" + "User Name='login';" + "Password='pass'"); The problem is it complains that the first piece of the string isnt correcty formed. Any ideas? Regards, Gareth.

      W Offline
      W Offline
      Wayne Phipps
      wrote on last edited by
      #2

      I don't use MySQL myself but just looking at your string there are three comments: 1) shouldn't "Network Address=ip:3306" be something like "Network Address=127.0.0.1:3306" 2) you use the ";" as a seperator but it's missing from the first aurument. 3) you've got quote marks "'" around most of the arguments except the first. This would give the first line the following format: ("Network Address='127.0.0.1:3306';" Just an idea..

      Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog

      W 1 Reply Last reply
      0
      • W Wayne Phipps

        I don't use MySQL myself but just looking at your string there are three comments: 1) shouldn't "Network Address=ip:3306" be something like "Network Address=127.0.0.1:3306" 2) you use the ";" as a seperator but it's missing from the first aurument. 3) you've got quote marks "'" around most of the arguments except the first. This would give the first line the following format: ("Network Address='127.0.0.1:3306';" Just an idea..

        Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog

        W Offline
        W Offline
        Wayne Phipps
        wrote on last edited by
        #3

        I found this page which lists different connection strings dependant on the API (driver) you use: http://www.connectionstrings.com/?carrier=mysql I don't know if it helps?

        Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog

        G 1 Reply Last reply
        0
        • W Wayne Phipps

          I found this page which lists different connection strings dependant on the API (driver) you use: http://www.connectionstrings.com/?carrier=mysql I don't know if it helps?

          Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog

          G Offline
          G Offline
          Gareth H
          wrote on last edited by
          #4

          Hi Wayne, Thanks for the website, looks very helpful. Though, i have a new problem now. An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Any ideas? Regards, Gareth.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups