Getting Started with Building A Database Driven Website

Hello,

Just got Kevin Yank’s book, ‘Build Your Own Database Driven Web Site’ and in Chapter 1 I installed MAMP … but when I tried to check mysqladmin -u root status in Terminal I get the message mysqladmin: command not found.

Previous to that I used sudo su … echo ‘/Applications/MAMP/Library/bin’ >> /etc/paths.d/MAMP … exit to install other MySQL programs built into MAMP, and that seemed to work.

Then, after placing the today.php file from the code-archive into my root folder at /Applications/MAMP/htdocs and then typing //localhost/today.php into the browser I get a ‘cannot connect’ error message.

Can you point out where I’m going off track so I can move ahead?

Thanks.

Any feedback on this? In Kevin’s book he said if I got stuck come here for help.

Thanks.

Have you tried:

http://localhost/today.php

to access the file?

With regard to the database connection., run this:

<?php
phpinfo();
?>

Do you see either mysql or mysqli listed anywhere in the output?

I used localhost/today.php and got this error message: The requested URL //today.php was not found on this server.

And … In Coda > Preview I got this:

Today’s date (according to this web server) is Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Los_Angeles’ for ‘PST/-8.0/no DST’ instead in /- on line 13 Monday, January 11th 2010.

I typed the php code into a Coda doc and saved it in ‘MAMP > htdocs’ and once again, could not get the browser to find it. Looking at the code in Coda > Preview returned the following, which does include ‘mysql’ and mysqli’.

Any other suggestions?

P.S. I’m a newbie at this … sorry and thanks.

phpinfo() PHP Version =&gt; 5.3.0 System =&gt; Darwin Michaels-BigMac.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 23:08:29 PST 2009; root:xnu-1486.2.11~3/RELEASE_I386 i386 Build Date =&gt; Oct 4 2009 23:38:52 Configure Command =&gt; '/var/tmp/apache_mod_php/apache_mod_php-53~122/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-53~122/Root/usr/local' '--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-53~122/Root/usr/local' '--enable-gd-native-ttf' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--enable-mbstring' '--enable-mbregex' '--with-[B]mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-[/B]sock=/var/mysql/mysql.sock' '--with-iodbc=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr' '--with-pcre-regex=/usr' Server API =&gt; Command Line Interface Virtual Directory Support =&gt; disabled Configuration File (php.ini) Path =&gt; /etc Loaded Configuration File =&gt; (none) Scan this dir for additional .ini files =&gt; (none) Additional .ini files parsed =&gt; (none) PHP API =&gt; 20090626 PHP Extension =&gt; 20090626 Zend Extension =&gt; 220090626 Zend Extension Build =&gt; API220090626,NTS PHP Extension Build =&gt; API20090626,NTS Debug Build =&gt; no Thread Safety =&gt; disabled Zend Memory Manager =&gt; enabled Zend Multibyte Support =&gt; disabled IPv6 Support =&gt; enabled Registered PHP Streams =&gt; https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar Registered Stream Socket Transports =&gt; tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters =&gt; zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk This program makes use of the Zend Scripting Language Engine: Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

I too am stuck! I downloaded the first four chapters and was successful in all three installations of msql,apache and php, I am at the post installation part and stuck, what does he mean by mysqladmin I dont see it anywhere.

he says “This means you can pop open a Terminal window (or inWindows, a Command
Prompt” I am running windows7 32 bit version, does this apply?

I know this is all simple but I cant seem to figure this out, If someone can help with the two items id appreciate it.

Okay, found the c: prompt barried in accesories, forgot about that one, now I enter the

“mysqladmin -u root status”

but get nothing! now what?