Mysql error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shasyraj
    New Member
    • Oct 2011
    • 1

    Mysql error

    i got this error after uploading all the files in www folder. i'm using webserver

    Code:
    <?php
    /// For the following details,
    /// please contact your server vendor
    
    $hostname='localhost'; //// specify host, i.e. 'localhost'
    $user='server username'; //// specify username
    $pass='server pass'; //// specify password
    $dbase='mysql db'; //// specify database name
    $connection = mysql_connect("$localhost" , "$server user" , "$server pass") 
    or die ("Can't connect to MySQL");
    $db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
    ?>
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'aeoranny'@'loc alhost' (using password: YES) in /home/aeoranny/public_html/wedlock/connect.php on line 10
    Last edited by Niheel; Oct 2 '11, 05:13 AM. Reason: merging errors and question
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    avoid double quotes(") to avoid, its unnecessary, and make sure your host, username, password is ok
    make sure your username with the host name has the actual privileges to access your database.

    Comment

    Working...