Wrox Programmer Forums
|
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 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
 
Old May 24th, 2004, 05:14 PM
Authorized User
 
Join Date: May 2004
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


 
Old May 24th, 2004, 05:49 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
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
::::::::::::::::::::::::::::::::::::::::::
 
Old May 24th, 2004, 05:50 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
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
::::::::::::::::::::::::::::::::::::::::::
 
Old May 25th, 2004, 01:11 PM
Authorized User
 
Join Date: May 2004
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






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





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