DSN-less connection to an external MySQL database

Discussion in 'Databases' started by horsted, Jan 27, 2010.

  1. Hi,

    I'd like to connect to an external MySQL database from my Winhost account. Can someone please give me a sample connection string? I'm using asp rather than php.

    I was using the following on the host that I used before moving to Winhost, but it isn't working here:

    Code:
    Dim con_STRING
    con_STRING = "driver={MySQL ODBC 3.51 Driver};option=16387;server=123.123.123.12;user=USERNAME;password=PASSWORD;DATABASE=DBNAME;"
    Thanks in advance.
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

  3. Excellent, thank you. I'll give it a go.
     
  4. I'm not really sure what to do here.

    I'm thinking that I need to download and install the MySQL driver onto my webspace in order to use the driver in my connection strings?

    Could someone please let me know if that is the correct thing to do? If not, what is? If so, do I download the 32-bit version because I'll be downloading it to my PC or the 64-bit because I'll ultimately upload it to Winhost's servers?

    All advice gratefully received.

    Thank you.
     
    Last edited by a moderator: Oct 14, 2015
  5. Ray

    Ray

    What are you trying to do? It sounds like you are trying to upload the MySQL databse/server to our web server. You cannot do this. You need to download and setup your MySQL server/database on your own computer and set it up so that it can be accessed remotely.
     
  6. Not trying to upload the MySQL database to your server, just trying to create a connection.

    I've tried unsuccessfully to use ODBC/Provider-type connection strings. I was guessing that I needed to install something on the server in order to make the connection work.

    My remote MySQL database can definitely be accessed - I've done it before from another host, but for some reason I can't make a connection from Winhost.

    Do I need to upload anything to Winhost's server to connect to a remote server using a Provider-type connection string?
     
    Last edited by a moderator: Oct 14, 2015
  7. Ray

    Ray

    What is the exact error you are getting?

    What is the connection string you are using?

    What are you using to connect to your MySQL server?

    Are you using classic asp, .net, or php?
     
  8. I've tried this:

    Code:
    Dim con_STRING
    con_STRING = "Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;"
    and this:

    Code:
    Dim con_STRING
    con_STRING = "Driver={MySQL ODBC 3.51 Driver};Server=myServerAddress;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;"
    but can't get either one to work.

    Didn't really expect the ODBC one to work, but thought that maybe the Provider one was for where ODBC drivers hadn't been uploaded to the server.

    I'm using classic asp. Could you possibly tell me where I'm going wrong?
     
  9. Ray

    Ray

    I don't think we have any MySQL drivers installed on the server.
     
  10. That's why I'm asking whether it's possible to upload them, if it's permissible to upload them, where they might be uploaded, and which ones they should be.

    Similarly, is there an alternate way for me to connect from Winhost to my remote MySQL database?
     
    Last edited by a moderator: Oct 14, 2015
  11. Ray

    Ray

    I believe so if it is .Net. Not really sure for PHP I myself haven't had the chance to test it.
     
  12. I'm using classic asp rather than .Net - any clues?
     
  13. Ray

    Ray

    I don't think there's a distributable MySQL driver for classic ASP. I believe they only have it for .Net.
     
  14. Could the ODBC Driver for MySQL not be installed?

    http://www.mysql.com/products/connector/
     
  15. Ray

    Ray

    I'm afraid not.
     
  16. Then I'm going to have to find another web host.:(
     

Share This Page