Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 19th, 2004, 07:19 AM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 23, Point 2, Error 1046

Hi,

I'm new to all this, but even I can see that this is probably a completely dumb thing to ask, but I just can't see an answer. I followed the book exactly as written but when I get to page 23 (23 of 700!), having opened the MySQL monitor for the first time I get the following.

When I type:

mysql> DELETE FROM user WHERE Host='localhost' AND User='';

The response is:

ERROR 1046: No Database Selected

What do I do to make it give me:

Query OK, 1 row affected (0.46 sec)


Can anyone please help so I can get at least 1 chapter under my belt?
Reply With Quote
  #2 (permalink)  
Old June 20th, 2004, 12:43 PM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok,

I seem to have fixed this now, but following the book it just didn't work with version 4.0.2a. So if anyone else has problems with page 23 this worked on mine.

Entering :

c:\mysql\bin\mysql mysql

gives an ERROR 1044: Access denied for user:'@localhost' to database'mysql'

Now a previous post by BuzzLY said to enter:
c:\mysql\bin\mysql -u root

Which works but then I got the ERROR 1046 as detailed above.
So finally after much fumbling around I entered:

c:\mysql\bin\mysql -u root mysql

Perhaps this is something to do with the version being 4.0.2a .... I don't know.
Reply With Quote
  #3 (permalink)  
Old June 20th, 2004, 01:16 PM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Finally,
Concerning page 23 point 3 :

mysqladmin reload

For me returned the following:

mysqladmin: reload failed; error: 'Access denied. You need the RELOAD privilege for this operation'

So.... whilst I still have hair on my head, I missed that line out, set the password and turned the page over....yeay!

Reply With Quote
  #4 (permalink)  
Old June 20th, 2004, 02:47 PM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Conclusion,

It is the version thats the problem. 4.0.20a-win & 4.0.20c-win produce the errors but 4.0.15-win works fine with the syntax that is in the book. Also page 24 talks about .cnf files which don't seem to exist in the newer versions. All very perplexing stuff for a newbie, especially when it is a bit of a hunt to find an older version to download.

Reply With Quote
  #5 (permalink)  
Old June 21st, 2004, 08:55 AM
Authorized User
 
Join Date: Apr 2004
Location: Cincinnati, OH, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Carlitio, glad you found the answer to your problem- that's why we tried to encourage the reader to visit the 3 sites: php.net, apache.org, and mysql.com for up-to-date releases/announcements/ bugs/fixes. At the time of writing the publication, we used the most recent stable releases available, but in such a dynamic industry, it is impossible to include things that haven't been released yet. Seeing as how there were 5 releases of MySQL between September and May, you can certainly understand the dilemma we face.

Keep up the good work- you'll be a pro in no time :)

Reply With Quote
  #6 (permalink)  
Old June 24th, 2004, 07:35 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A better solution than using old MySQL versions:

Connect as root using the following command:
mysql -u root -p mysql

After this the prompt will ask you for a password which is set to 'root' as default in newer versions of MySQL. Like this:

-------------------------------------------------------------------
C:\mysql\bin>mysql -u root -p mysql
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.0.20a-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
-------------------------------------------------------------------

You can set the password for root by using the 'update' command:

-------------------------------------------------------------------
update mysql.user set password='wrox' where user='root'
-------------------------------------------------------------------

This will change 'wrox' as a password for root user.

(Thx to anand_smart@http://forums.devshed.com)
Reply With Quote
  #7 (permalink)  
Old July 9th, 2004, 10:26 AM
Authorized User
 
Join Date: Jun 2004
Location: New York, New York, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to redcell184
Default

Quote:
quote:Originally posted by carlitio
 Conclusion,

It is the version thats the problem. 4.0.20a-win & 4.0.20c-win produce the errors but 4.0.15-win works fine with the syntax that is in the book. Also page 24 talks about .cnf files which don't seem to exist in the newer versions. All very perplexing stuff for a newbie, especially when it is a bit of a hunt to find an older version to download.

How did you solve the problem and what is the version you are currently using so i can also use it....

Reply With Quote
  #8 (permalink)  
Old July 9th, 2004, 11:06 AM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Currently I am using the old versions that are stated in the book. Main reason being I don't want any other little errors like these as I read on. Once I have completed the book and have a bit of experience I will upgrade to the latest versions. So for now :

Apache 2.0.49 (Win32), PHP 4.3.7, MySQL 4.0.15-win
Reply With Quote
  #9 (permalink)  
Old July 9th, 2004, 12:38 PM
Authorized User
 
Join Date: Jun 2004
Location: New York, New York, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to redcell184
Default

Where did you go to download it??

or all the older versions of mysql

Reply With Quote
  #10 (permalink)  
Old July 9th, 2004, 01:52 PM
Authorized User
 
Join Date: Jun 2004
Location: Coventry, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If I remember right I couldn't find the older version on www.mysql.com. I found it somewhere thru google.
Reply With Quote
Reply


Thread Tools
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
Ch1 MySQL returns Error 1046: No database selected aiche_ag BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 October 1st, 2007 02:47 PM
how to export .asp page to power point slide star12345 General .NET 2 August 24th, 2007 12:04 AM
Error 823 : I/O error 23 CRC Anuja Jadhav SQL Server 2000 2 March 20th, 2007 09:00 AM
Chapter 1, Page 23 golden_drifter BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 7 July 9th, 2004 12:12 AM



All times are GMT -4. The time now is 07:37 PM.


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