SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast AimyThomas's Avatar
    Join Date
    Sep 2011
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Need Help in Access Error

    Hello Again,

    Please help with this link problem.

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


    <?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();

    Thanks in advance

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,027
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Check that the username, password and database are correct and that the username has permission to access the database.

    btw you should really consider migrating over to either the mysqli or the PDO extenstions.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    To reiterated @SpacePhoenix ;s point, it looks as though you need to study the mysql permissions system -- and in case you miss this snippet of information, probably one of the most common gotchas in LAMP development, mysql flush privileges when you are done.

    That is if you got the password correct in your attempt of course ...


Bookmarks

Posting Permissions

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