>> Setting up Mac OS X Panther as a web server
with Apache, PHP, MYSQL, PHPMySQL & AMFPHP

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 phpMyAdmin to manage MySQL database on Mac OS X

Download phpMyAdmin from here:
http://www.phpmyadmin.net/documentation/


Pre-requisite: Have installed Apache with PHP and MySQL (see above)

Let's install and configure PHPMyAdmin, a data base management tool.

What I did not understand initially was that MySQL is the database engine and you still need some way of getting the database set up. This is the GUI, Graphical User Interface.

Download latest program, unstuff and rename folder phpMyAdmin and copy to /Library/WebServer/Documents/ right next the index.php file we created earlier.

Inside the phpMyAdmin folder, open up with Dreamweaver the config.inc.php file, and inside change this line:

$cfg['PmaAbsoluteUri'] = '';

to:

$cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/';

[If your server has a domain name, substitute www.yourdomain.com in place of localhost above.]


This line should look like this:

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL host name


This line should look like this:

$cfg['Servers'][$i]['controluser'] = 'root'; // MySQL control user settings


Insert your MySQL password into the password type below:

$cfg['Servers'][$i]['controlpass'] = 'password'; // access to the "mysql/user" settings


This line should look like this:

$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?

Save your file then click on this link to bring up MYPHPAdmin:

http://localhost/phpMyAdmin/index.php

When you do if everything was done correctly, you should pull up a browser window that you can select a language in. Then it will tell you you need a blow fish password.

So do a search in the config.inc.php file for blowfish_secret and type in your same MySQL password here as you did before:

It should look similar to  this:

$cfg['blowfish_secret'] = 'your mysql password here';

Save your file and go back to the link you where just at and it shold now have a place for you to type in your user name and password.

Type in:

root

For the user and:

Your MYSQL password

For the password.

You should now see a gray vertical column down the left side of the page and two columns with MySQl in the first column head and phpMyAdmin in the second column head.


  
Write down your passwords before you forget them.

The above article was modified and simplified version of an article posted on MacServers.org  http://www.macservers.org/feature-2.html


>> Creating my first database with phpMyAdmin/MySQL
while importing an Excel file


Once you log in to phpMyAdmin, under MySQL you will see a test box where you can type in the name of your first database. So I typed in “brdi” and clicked on create.

Well things can be a little scary when you start something new. You are thinking is this a temperamental program that I am going to mess up my entire system with. Or am I going to do something that I can’t fix or can’t fix easily. Funny time to get scared, at this point.

Well even if you mess up I think it looks like it is easily fixable. Just as easy as you can create a new database you can delete it. Keep to the buttons though, do not use your forward and backward arrows on your browser, this will mess things up. So if you don’t like what you created at any time you can go to the drop tab (top, right) click on it and it will ask you if you are sure you want to drop/delete this database. And then it is gone. If you look in the gray vertical column on your left you can see the new name of your database. Above this is a combo box, that you can drag to any of many databases you will create in the future.

Next you are given a blank text area to type in the name of your table. Then type in how many fields you will have. In my case it is 10 columns, so I put 10 in the Fields text area and hit the go button.

Note: It is important to match exactly how many columns are in the Excel file exactly for things to import correctly.

Next in the field type the name of each columns content title names. In my case I am typing these names: date, searchterm, avgposition, totalimpressions, totalclicks, CTR, avgcost, totalcost, and CPC. Next we want to define the “Type” column. Similar to Flash MX 2004 Data Typing.


Note: if you do use date, leave the length column blank.

Click on the documentation link above the column to learn more about the differences, then make your choices. The length column it the maximum number of spaces that the content will take. Make your choices here. Then click on the save button at the bottom of page.

Next I open the Excel file with Excel and export it as “Text (Tab delimited)” file and add “–tab” to the file name as a reminder to myself of what I have done. The file is automatically changed to a .txt file which is good.
   
Now You want to open this file in Dreamweaver. I thought this would be a much easier or streamlined task but there are a few things we need to do. It is much easier to do this in Dreamweaver. Any column names or document names or information that is not part of the columns data, select and delete. This way you just have rows of tab spaced information, and even though not every row matches up in straight columns, that is not important.  Save it.

Inside of PHPMyAdmin, under the “Structure “ tab of the database we already started, go to the bottom of the page. You will see a link that says: “Insert data from textfile into table”. Click on this ink. Browse to the location of your text file on your Mac.


Browse to your tab delimited file on your hard drive.
Replace is checked
Terminated fields \t   ( you are using the tab approach)
Fields enclosed by option select box
Lines terminated by \r   (means you are ending each row with a carriage return, all this is already set up for you)
Load method ...Data

Then click on submit. It should load everything into your database.

Click on the Browse tab at the top to review all that has been imported.

If you want to add other tab delimited data to this database click on the “structure tab” then select “Insert data from textfile into table”, use the same steps as above but leave replace unchecked. You do not want to replace your already imported data.   

To create a back up file click on the  “Export” tab at the top of the page. On this page make sure the check box is selected for “Structure” and “Data” and compression is set to “None”. Using Internet Explorer I got an error message when I used compression of “zipped”, Make sure “Save as file” is checked. Then select go. This can save a back up file to wherever you want to save it.

What is also interesting here is if you choose to save it as an xml file, it can also save all of your data as an xml document. Though you will have to copy and past it into a Dreamweaver MX 2004 xml document. This could be handy.

 

Daryl Urig
Total Media Source
contact@TotalMediaSource.com



NEXT >>

 

       

 

 


Created and Hosted by TotalMediaSource.com ©2003 all rights reserved