Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Access Error

  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    10
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Access Error

    Please help with this connection problem.

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myuser'@'localhost' (using password: YES)


    <?php
    function connectTo() {
    $host = "localhost";
    $db_name = "myDB";
    $username = "myUser";
    $password = "passs";
    $link = mysql_connect("$host", "$username", "$password", "$db_name");
    return $link;
    }
    ?>

    in another file is this line

    $link = connectTo();

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    17,027
    Thanks
    4
    Thanked 2,668 Times in 2,637 Posts
    Your credentials are invalid. Either myuser isn't capable of logging onto localhost, the username isn't correct, or the password is invalid.

  3. Users who have thanked Fou-Lu for this post:

    greenhat (09-17-2012)


 

Posting Permissions

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