PHP DatabasesUsing 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
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'.
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.
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..