your code can't connect to your database.. i'm no expert but you might have entered the wrong database url. (the root@localhost)
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 ...
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
your code can't connect to your database.. i'm no expert but you might have entered the wrong database url. (the root@localhost)
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.
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?
Bookmarks