Results 1 to 4 of 4

PHP error: Warning: mysql_connect() [function.mysql-connect]: Access denied for

This is a discussion on PHP error: Warning: mysql_connect() [function.mysql-connect]: Access denied for within the Web & Server Administration forums, part of the Web Designing & Development category; user 'root'@'localhost' (using Hi I am trying to use a working php class for creating a php login and i ...

  1. #1
    jam
    jam is offline
    Junior Member Array
    Join Date
    Feb 2008
    Posts
    2

    Default PHP error: Warning: mysql_connect() [function.mysql-connect]: Access denied for

    user 'root'@'localhost' (using Hi

    I am trying to use a working php class for creating a php login and i am getting error:
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in D:\xampp\htdocs\mafiasession\class_mafiarelbd.php on line 120
    MYSQL=>Conexao negada


    ALL code:
    http://pastebin.ca/901462


    the only thing i chnaged is the orig login table insert statment had:

    INSERT INTO login ( `login` , `senhamd5` , `senhasha1` )
    VALUES ('mafiasession', MD5( 'mafiasession' ) , SHA1( 'mafiasession' ));


    i changed it to:

    INSERT INTO login ( `login` , `senhamd5` , `senhasha1` )
    VALUES ('root', MD5( 'police' ) , SHA1( 'police' ));


    because i set my user root password as: police

    Please help,

    Thanks in advance

    Tovia Singer

  2. #2
    Junior Member Array
    Join Date
    Feb 2008
    Posts
    1

    Default

    your code can't connect to your database.. i'm no expert but you might have entered the wrong database url. (the root@localhost)

  3. #3
    Junior Member Array
    Join Date
    Feb 2008
    Posts
    2

    Default

    There's no reason why the mysql_connect function shouldn't work as long as the MySql client has had the user "root" with the password of "YES" defined with the correct attributes for create, write, read, execute and possibly delete if necessary.

    Extract:
    Managing Databases

    Although all the database administrative options can be done through PHP scripts, I strongly suggest installing a copy of PHPMyAdmin on your server. It is an excellent free set of scripts that will provide you with an administrative interface for your MySQL database(s). You can add, remove, edit, backup and view your databases using this and it is especially useful when troubleshooting your databases.

  4. #4
    Junior Member Array
    Join Date
    Feb 2008
    Posts
    1

    Default

    Hi. It looks like php does not connect to mysql properly.

    Did you try to connect to your mysql with username root and password police? Try doing so by using the command line and executing mysql from there (or phpmyadmin, or mysql client tools).

    If it is the correct password and you still cannot connect read this:
    http://dev.mysql.com/doc/refman/5.0/en/old-client.html
    and see if it can cover you (using SET PASSWORD FOR
    'root'@'localhost' = OLD_PASSWORD('police'); will do the trick for you)

    What mysql version do you use? Is it the only script that connects to mysql?



Similar Threads

  1. Replies: 2
    Last Post: 08-26-2011, 02:29 AM
  2. Replies: 3
    Last Post: 04-04-2011, 12:01 PM
  3. Dreamweaver can't connect to mySQL db with Godaddy?
    By Andy in forum Web & Server Administration
    Replies: 4
    Last Post: 02-17-2009, 07:48 AM
  4. Adsense warning!
    By cyberbog in forum Google
    Replies: 0
    Last Post: 02-15-2008, 10:48 AM

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
  •  
SEO Forum | Web Hosting Forum | Websites For Sale |