Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MySQL connection string help

Options
  • 31-08-2004 9:18pm
    #1
    Registered Users Posts: 577 ✭✭✭


    Hi am new to Mysql and am looking for the correct connection string format

    eg..

    "Provider=MYSQL??;Password=blah;User ID=blah;Data Source=mysql.hosting365.ie"

    The Mysql is running on hosting365 on a windows2003 machine

    Thanks in advance for any help on this


Comments

  • Registered Users Posts: 1,967 ✭✭✭Dun


    Are you looking for a php connection string? Or are you looking to connect over a command line?
    Command line:
    c:\mysql\bin\:> mysql -h server -u user -p
    (then it prompts for your password). type connect databasename to connect to a database.

    If it's the php code you're looking for, it's:

    [php]
    /* These are the variables to connect to the database */
    $hostname = "databaseserver.com";
    $username = "username";
    $password = "password";
    $database = "databasename";
    // This is to create the connection:
    $connection = mysql_connect($hostname,$username,$password);
    // And this is to choose the database:
    $db = mysql_select_db($database,$connection);
    [/php]


  • Registered Users Posts: 577 ✭✭✭Velcrow


    Thanks for that!!

    I am using ASP - but I think I can convert what you have and make another effort.


  • Registered Users Posts: 1,967 ✭✭✭Dun


    Ah right. Have a look at this.


  • Registered Users Posts: 577 ✭✭✭Velcrow


    Once again - Thanks, Up and working!


Advertisement