Setting up Apache on Mac OS X
Installing MySQL on Mac OS X
Installing AMFPHP (Fleash Remoting) on Mac OS X
Installing phpMyAdmin to manage MySQL database on Mac OS X
A Guide to Setting up VNC on Mac OS X Panther
"Working on your computer remotely"
This is my first time of posting some of my learning, so if you see anything at all that could be improved please e-mail your comments to: contact@TotalMediaSource.com
Thank you, Daryl Urig
>> Installing MySQL on Mac OS X
Well this was easy, I think. Rory gave me a great link to:
http://www.serverlogistics.com/mysql.php
You just download the complete package. Double click the install and a few agreements and you are done.
The install guide mentioned two things I could not find or work out. First setting up a short cut to mySql in the command line, so if I understand this, I will need to type in:
shell> /Library/MySQL/bin/mysql
Well things could be worse, unless some one can help me figure this out.
And then there was the dragging the
MySQL.prefPane

Icon into the right folder, what right folder I could not find it. So I opened the “System Preferences” under the apple, and drag it straight onto to it, what the heck, well it asked me if I wanted to install it for all users or just one. I picked all to give everyone access to it. And it completed the rest.
Now I just had to follow the rest of the directions and click on the MYSQL icon in “System Preferences”, initialize, start, set root SQL password, not the same as root user password. It even set up my MYSQL user automatically.
It works.
While I was at ServerLogoistics I went ahead and downloaded phpMYAdmin, it is suppose to make things easier in setting up MySQL data tables and such. We’ll see. I will come back here later: http://www.phpmyadmin.net/documentation/
I wanted to test out MySQL, so I went back to MacDevCenter.com and got this code:
<?
print "<pre>";
// log into our local server using the MySQL root user.
$dbh = mysql_connect( "localhost", "root", "" );
// select the 'test' database created during installation.
mysql_select_db( "test" ) or die ( mysql_error() . "\n" );
print "Connection to the database has been established.\n";
// create a simplistic table.
$table = "CREATE table wisdom (
id int(4) PRIMARY KEY AUTO_INCREMENT,
wisdom char(255), author char(125) );";
$response = mysql_query( $table, $dbh );
if ($response) { print "The table was created correctly!\n"; }
else { print mysql_error () . "\n"; }
// now, we'll add some data to our newly created table.
// to add different wisdom, just change the 'values'.
$insert_data = "INSERT into wisdom ( wisdom, author )
values ( 'Must... remain... awake!', 'Morbus' );";
$response = mysql_query( $insert_data, $dbh );
if ($response) { print "The data was inserted correctly!\n"; }
else { print mysql_error () . "\n"; }
// and read it back for printing purposes.
$get_table_data = "SELECT * FROM wisdom;";
$response = mysql_query( $get_table_data, $dbh );
if ($response) { print "We successfully got all the table data.\n"; }
else { print mysql_error () . "\n"; }
// now print it out for the user.
while ( $one_line_of_data = mysql_fetch_array( $response ) ) {
extract ( $one_line_of_data );
print "#$id: $author sez: \"$wisdom\"\n";
}
print "</pre>";
?>
I went back to where my index.php page was. Double clicked on it to open it in Dreamweaver, resaved it as
test-MYSQL.php
I had set as one of my favorites in my web browser my local host address, so I went there and then after the forward "/" slash of my address typed in:
test-MYSQL.php
Well it gave me an error. What I could get out of the error was that it did not like my password in the php page I just created. Well I did not put a password in it. So I looked at the Dreamweaver page and on about line 6 it says
( “localhost”, root, “” );
Well my java class made me think that this is missing something here between these two quote marks. So I added my MySQL root password in there:
( “localhost”, root, “xyz” );
Resaved the Dreamweaver php file, refreshed my page, and now it works. Cool, that is why we need that MySQL user password. Went back and changed the root password to something unique so I would not be broadcasting my regular password to everyone in the php file, resaved, refreshed, everything works.

Daryl Urig
Total Media Source
contact@TotalMediaSource.com
NEXT >>
|