essjay_d12 Posted May 30, 2006 Share Posted May 30, 2006 I'm using the following packages....php-4.3.3-Win32 and mysql-4.1.19-win32 on ApacheHowever i'm getting the following error...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]SELECT command denied to user 'admin'@'localhost' for table 'films'.[/quote]I'm trying to access in PHP like the following...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$conn = mysql_connect("localhost", "admin", "adm1n");mysql_select_db("project",$conn);[/quote]And my tables and users were created like the following in MySQL[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]CREATE TABLE films (ID_NO int(11) not null primary key, F_NAME varchar(100), F_DIRECTOR varchar(100), F_REVIEWER varchar(100), F_USERNAME varchar(50), F_DATETIME datetime, F_TYPE varchar(1000), F_SUMMARY varchar(2000), F_REVIEW varchar(10000), F_SCORE varchar(4));GRANT ALL PRIVILEGES ON project TO 'admin'@'localhost' IDENTIFIED BY 'adm1n';SET PASSWORD FOR 'admin'@'localhost' = OLD_PASSWORD('adm1n');[/quote]What am I doing wrong??Do I need a different version of either MySQL of PHP?ThanksSimon Quote Link to comment https://forums.phpfreaks.com/topic/10765-php-denies-access-for-user-in-mysql-database/ Share on other sites More sharing options...
poirot Posted May 30, 2006 Share Posted May 30, 2006 Probably because either "admin" has no privileges or maybe there's not even a user called "admin".If you are using a server package to test on localhost, you should try "root" as username and "root" as password (or sometimes leave the password blank). Quote Link to comment https://forums.phpfreaks.com/topic/10765-php-denies-access-for-user-in-mysql-database/#findComment-40236 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.