Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 Search this Thread Display Modes
  #1 (permalink)  
Old May 24th, 2004, 05:14 PM
Authorized User
 
Join Date: May 2004
Location: Charlestown, MA, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default createmovie.php logon trouble

Hi;

    I am using your book Beginning PHP, Apache, MySQL Web Development and the last 5 digits of the ISBM number are: 5744-0.
    The first program in Chapter 3 "createmovie.php" is giving me serious grief. First of all, I copied the program from the code provided on the web site for the book, so I have a high confidence that there are no typos.
    In line 9,

mysql_query("CREATE DATABASE IF NOT EXISTS wiley")
     or die(mysql_error());

I tried to use the code in the book but got an error that the command "mysql_create_db ("wiley")" was "depreciated" (whatever that may mean) and to use the command "mysql_query" as shown above. My values for the connection I have made (in line 4) are "localhost", "jah", "JohnAlden". Since I made myself a user (with these values) from your example on page 27 mysql allowed me to connect. Unfortunately, while I may be allowed to connect, I am not allowed to create a database. My guess is that one must be an administrator to use the "CREATE DATABASE" command. The crash at (I believe) line ten results in the error "Access denied for user: 'jah@localhost' to database 'wiley'.
    Now perhaps I missed it somewhere, but I don't see how the book ever mentions how to make myself an administrator for mysql. They did mention that one should be "signed on" as "root" (the default administrator that comes with mysql), but I have no idea if the user name is "root" what possible password goes with that (I tried a null for a password = "", but that didn't work either).
    Thanks for some help with this problem.

John Alden Hall 617-241-9050


Reply With Quote
  #2 (permalink)  
Old May 24th, 2004, 05:49 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

If you haven't set a password then NULL should work
e.g. mysql_connect('localhost', 'root', NULL);

Read the following documentation about granting user permissions and setting up accounts:
http://dev.mysql.com/doc/mysql/en/De...rivileges.html
http://dev.mysql.com/doc/mysql/en/Adding_users.html

BTW to get into the mysql command line run mysql.exe in the bin directory.



Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old May 24th, 2004, 05:50 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Oh and if you have set the root password here's where you'd find out how to reset it.
http://dev.mysql.com/doc/mysql/en/Re...rmissions.html

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #4 (permalink)  
Old May 25th, 2004, 01:11 PM
Authorized User
 
Join Date: May 2004
Location: Charlestown, MA, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by richard.york
 Oh and if you have set the root password here's where you'd find out how to reset it.
http://dev.mysql.com/doc/mysql/en/Re...rmissions.html

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::

Following the instructions to reset the "root" password did it. I reset the password to "" and then ran createmovie.php with the values ('localhost', 'root', NULL) as you suggested and it ran fine. What a lifesaver and thanks for the help.

Best,
JAH

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
Trouble connecting MySQL to PHP nofences84 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 14th, 2007 11:21 PM
potential createmovie.php error ElizabethN BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 8 August 25th, 2004 09:46 AM
trouble with Email and PHP Tachyon Beginning PHP 3 May 26th, 2004 03:58 AM
Error troubleshooting - createmovie.php samgman BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 May 13th, 2004 01:24 AM
createmovie.php joebloggs BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 11 April 26th, 2004 06:37 PM



All times are GMT -4. The time now is 07:48 AM.


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