Categorized | MySQL

How to resolve the following error with MYSQL while connecting with PHP?

Posted on 10 April 2010 by Abidoon

I get the following error while connecting php with mysql. “Access denied for user ‘ODBC’@'localhost’ (using password: NO)”.How to resolve this? what should be my username?

Tags | , , , ,

One Response to “How to resolve the following error with MYSQL while connecting with PHP?”

  1. jeetu N says:

    mysql_connect() takes 3 params
    localhost
    ur database user name generally ‘root’
    db pass

    use this snippet and let us know if it works
    < ?php
    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    // mysql_user - put ur db user name
    // mysql_password - put ur db password

    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($link);
    ?>


Leave a Reply