Connecting to MYSQL with PHP

Discussion in 'Databases' started by JohnBF, Oct 26, 2012.

  1. Newbie (for PHP/MySQL) question:

    The PHP connect statement wants host, user, and password. No problem about password. I've tried every combination of the MySQL Server Name, Database Login, and Database Login that appears on the Database Manager page, plus the user name for my discountasp account. The connect statement always fails.

    Can anyone clue me in on the correct items to use? Thanks.

    /John
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    What's the error message? All the connection credentials are provided to you in the Control Panel under the MySQL Manager section.
     
  3. Right. The question is which items from the database manager page to use for each connect statement parameter. Nothing I've tried works. The item I'm least sure of if the second parameter, which PHP calls "user". In any case, everything I try results in the error message...

    Connection to MySQL-server failed!PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'TRIED VARIOUS ITEMS' (using password: YES) in E:\web\MY ACCOUNT\htdocs\PHP\Connect.php on line 33
     
  4. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    When you look into the Control Panel:

    $host -> MySQL Server Name
    $user -> Database Login
    $password -> Database Password
     
  5. Yes that works. I thought I tried that combination but I guess not. Thanks!

    /John
     
  6. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    Glad we could help out. :)
     

Share This Page