Mysql database problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eminosoft
    New Member
    • Feb 2008
    • 6

    Mysql database problem

    This is the problem i am getting. It is simple but i am new to the PHP.

    "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localho st' (using password: YES) in D:\wamp\www\ddd d.php on line 2
    Could not connect: Access denied for user 'ODBC'@'localho st' (using password: YES)"
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    can you log in to the Mysql directly without using PHP?

    please post you connection code.... your password user combination probably isn't valid

    Comment

    • werks
      New Member
      • Dec 2007
      • 218

      #3
      Post your code so we can analyze it..

      --
      Kenneth
      "Better Than Yesterday"

      Comment

      • Eminosoft
        New Member
        • Feb 2008
        • 6

        #4
        Originally posted by harshmaul
        can you log in to the Mysql directly without using PHP?

        please post you connection code.... your password user combination probably isn't valid
        This code was retrived from google search. If any mistacks in this plz tell. I am beginner of PHP. I have little bit knowledge in that. plz tell.

        password: sreeni

        <?php
        $con = mysql_connect(" ","","sreen i");
        if (!$con)
        {
        die('Could not connect: ' . mysql_error());
        }
        // some code
        mysql_close($co n);
        ?>

        Comment

        • harshmaul
          Recognized Expert Contributor
          • Jul 2007
          • 490

          #5
          Your code seems to be fine.

          Try two things for me please....

          Log in using the credentials to the MySql command line interface, if you have access to that.

          And if not...
          just to make sure the user names and passwords fill in the blanks for the following code, and try a simple select statement (select * from tbl***)

          Code:
          $username="";    //the user name (maybe root)
          $password="";    //the password
          $database="";   //the database you will be using
          $host="";   //theMySql server you are trying to connect to
          mysql_connect($host,$username,$password);
          @mysql_select_db($database) or die( "Unable to select database");

          Comment

          Working...