Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 11th, 2009, 10:14 PM
Registered User
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a Database - Chapter 3

I'm having trouble with creating the database on page 87 of chapter 3. I downloaded the code from the site, so I know it's not a code issue. Also, if I use the MySQL root username and password I have no problems. If I use the book's suggested username (bp6am) and password (bp6ampass) I get the following message:

Access denied for user 'bp6am'@'localhost' to database 'moviesite'.

Can someone tell me what I'm doing wrong?

Thanks,
James
Reply With Quote
  #2 (permalink)  
Old March 14th, 2010, 06:29 PM
Registered User
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jamesmont View Post
I'm having trouble with creating the database on page 87 of chapter 3. I downloaded the code from the site, so I know it's not a code issue. Also, if I use the MySQL root username and password I have no problems. If I use the book's suggested username (bp6am) and password (bp6ampass) I get the following message:

Access denied for user 'bp6am'@'localhost' to database 'moviesite'.

Can someone tell me what I'm doing wrong?

Thanks,
James
Hi James,

I am having the same problem as above. Did you work out how to fix this?
Cheers,
ribbt
Reply With Quote
  #3 (permalink)  
Old March 14th, 2010, 06:36 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Did you create the user and give the proper grant?
Reply With Quote
  #4 (permalink)  
Old March 14th, 2010, 06:43 PM
Registered User
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
Did you create the user and give the proper grant?
Hi Peter,

Entered the following in mysql>

GRANT SELECT, INSERT, UPDATE ON *.*
TO bp6am@localhost
IDENTIFIED BY "bp6ampass";
(Query OK, 0 rows affected <0.05sec>)

Any other ideas?

Thanks,
ribbet
Reply With Quote
  #5 (permalink)  
Old March 14th, 2010, 07:21 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

I tested with this:

Code:
grant all privileges on *.* to 'bp6am' with grant option;
Login as root and do the above. I assume you already created user bp6am first.
Reply With Quote
  #6 (permalink)  
Old March 14th, 2010, 07:52 PM
Registered User
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
I tested with this:

Code:
grant all privileges on *.* to 'bp6am' with grant option;
Login as root and do the above. I assume you already created user bp6am first.
tried the above and get "can't find any matching row in the user table".

does the input: GRANT SELECT,INSERT,UPDATE ON *.* TO bp6am@localhost... actually create the actual user account or is there something before this that i may have missed?

Thanks
Reply With Quote
  #7 (permalink)  
Old March 14th, 2010, 08:00 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

No, grant does not create account. You have to first do the following:
Code:
CREATE USER 'bp6am' IDENTIFIED BY 'bp6ampass'
Then grant.

Afterwards you can use mysql client to test whether you can login as bp6am and whether bp6am can see the table.
Reply With Quote
  #8 (permalink)  
Old March 14th, 2010, 11:15 PM
Registered User
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, I tried the following so that i could start again:
Code:
drop user 'bp6am';
delete from mysql.user where host="localhost" and user="bp6am";
Logged in as 'root', and did the following:
Code:
CREATE USER 'bp6am' IDENTIFIED BY 'bp6ampass';
grant all privileges on *.* to 'bp6am' with grant option;
GRANT SELECT, INSERT, UPDATE ON *.*
TO bp6am@localhost
IDENTIFIED BY "bp6ampass";
I can login successfully through a command prompt using the above and can also execute the following:
Code:
show tables from mysql;
I also copied the chapter code to rule out my input error.

However, I am still getting am still getting the error:
"Access denied for user 'bp6am'@'localhost' to database 'moviesite' "

Anything else i may have missed? Are there any other tests i could run that require administrative privileges?
Reply With Quote
  #9 (permalink)  
Old March 15th, 2010, 02:14 AM
Registered User
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Scouring through mysql online documentation and it occured to me that 'grant all' is a higher level than 'grant insert, select etc..

Seeing the "Movie database successfully created!" was like a dream come true!

Cheers,
ribbet

Last edited by ribbet; March 15th, 2010 at 02:21 AM..
Reply With Quote
  #10 (permalink)  
Old October 10th, 2010, 11:11 PM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default I have resolve the problem!

GRANT CREATE,SELECT, INSERT, UPDATE ON *.*

add "CREATE" ,it works.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19: Creating the Recordset NuovoData BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 0 May 5th, 2009 08:16 PM
Chapter 4 - creating a view MarieMcKeeth BOOK: Beginning Ruby on Rails 1 March 21st, 2009 06:56 PM
Creating database and tables. chapter 9 PeterJB BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 August 1st, 2006 06:52 AM
Chapter 6 - Problem with creating an installer pliroforikarios BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 June 8th, 2006 11:53 AM



All times are GMT -4. The time now is 11:04 AM.


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