Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 2nd, 2005, 04:42 PM
Registered User
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default 1044: Access denied for user '@localhost ...

I have apache v1.3.27, PHP 4.3.2 MySQL 3.23.49 installed on Solaris.
The installation seems to be fine as i can successfully use mysqladmin, mysql commands to log onto my databases and do manipulation on the Solaris box.

But trying to access the database from Windows IE i get the following error:
1044: Access denied for user '@localhost'n to database 'name of database'.

Any help appreciated.

Old February 9th, 2005, 11:00 AM
Authorized User
Join Date: Jul 2004
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru

during login you might not given any username

the syntax is

you can try the following example but I am not sure whether it will work or not as I don't know ur username & password.

if($handler) echo "Connection success"; else die(mysql_error());

Best Regard:
Md. Zakir Hossain (Raju)
Old March 8th, 2005, 06:01 PM
Authorized User
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths


execute mysql from the shell ( you indicated that it worked that way) and issue the following command:

GRANT ALL PRIVILIGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Alternatively, to par down permissions,

GRANT ALL PRIVILIGES ON <Database Name>.* TO 'user'@'localhost' IDENTIFIED BY 'password';

  This is a relatively common problem/mis-configuration. I just spent some time banging my head wondering why my code wasn't working when I rememberd I did that on the DEVELOPMENT server but not the PRODUCTION server. oops.

Meredith Shaebanyan

Old April 16th, 2005, 03:27 PM
Registered User
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks, I did set up my password by using :
"set password for root@loacalhost=password('your_password');
log out "\q", and then log back with:
mysql -u root -p,
prompts for password! 'yourpassword'
and then I get the wellcome monitor screen.
then I make sure I place the same password in my PHP script, at hte
mysql_connect () function.
and I now get : Can't create database 'wiley'. Database exists.
My hole next week will be dvoted to this message NOW..

Similar Threads
Thread Thread Starter Forum Replies Last Post
phpMyAdmin - #1044 - Access denied for user crmpicco PHP Databases 0 October 21st, 2007 09:32 AM
access denied for new user, Chapter 3 kanjigirl BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 5 February 19th, 2006 05:08 PM
ERROR 1045: Access denied for user: OBDC@localhost kara333 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 December 4th, 2005 07:57 AM
Access Denied For User -Chapter 9 AMP_Engineer BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 5 September 25th, 2004 02:18 AM
Access denied for user wisconsin MySQL 13 June 17th, 2004 08:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.