Archive for February, 2009

Installing phpMyAdmin on Local Machine

Franz| February 15, 2009 8:43 pm

These are the steps I followed to install phpMyAdmin on my local machine, which is a MacBook Pro.  Substitute your own user name for “franz”.

  • Download the zip file from http://www.phpMyAdmin.net .  I downloaded version 2.11. Although there is a later version.
  • After Unzipping the file, I copied the folder to my Sites directory under /users/franz/sites
  • Using the finder, I navigated to those files, and created a folder called config in the phpMyAdmin folder.  I then set the write permission to read/write for that folder
  • I renamed the config.sample.inc.php by adding .bak, since I will be creating a new file with this name.
  • I started the configuration program by opening up a browser and entering:
http://localhost/~franz/phpMyAdmin/scripts/setup.php
  • I clicked under Servers the “Add” button
  • The only item I entered was the root password for the MySQL installation I had done
  • Click Add
  • On the next screen, make sure you click the “Save” under the Configuration section
  • This created a new file in the folder I created called “Config”.  I copied that file up to the parent directory and then deleted the Config folder.
  • I tried to start by entering the browser: http://localhost/~franz/phpmyadmin/
  • I had this error, which can happen on a Mac because it is looking for a file that has been moved to a new location.

phpmyadmin-error

  • To solve this, I openned up the terminal window and after loggin in entered the following commands:
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
  • I was then able to run phpMyAdmin by entering this into the browser
http://localhost/~franz/phpMyAdmin/
  • I then downloaded version 3 of phpMyAdmin and found the setup is a bit different.  You still have to create the config folder and make it read/write.
  • To configure use this URL instead:
http://localhost/~franz/phpMyAdmin/setup
  • Create a new server as shown above and then be sure to save the configuration.

Mac OS X 10.5 Web Sharing – Forbidden Error

Franz| February 13, 2009 8:22 am

With Leopard, the System Preferences pane is different.  There is now just a single option for web sharing.  Open System Preferences, Sharing and enable Web Sharing.  Apache2 is installed as a default.  You should see your local website using this in the browser (using your own user short name in place of “shortname”.

localhost/~shortname

If you upgrade to Leopard from a previous version of OS X, then you may get a “Forbidden 403″ message” instead of seeing your web page.  To fix go to this solution on the Apple website.

http://support.apple.com/kb/TA25038?viewlocale=en_US

Your web pages are stored in the folder /user/shortname/sites.  A default html page is located there, which should now come up.

Using MySQL with Microsoft Access and Filemaker Pro

Franz| February 10, 2009 9:54 pm

MySQL is an open source database that is used by millions of people each year.  It is very robust and scalable.  But to access it usually requires some type of custom program or a MySQL front end.  There are other good database applications, such as Microsoft Access and FileMaker Pro.  These applications make it easy to design forms to add and edit the data, and to create custom reports such as mailing labels.  By using ODBC you are able to get many of the benefits of these local programs and the benefits of using a MySQL database.  This is how to get start.

OBDC Driver

First you need to install a ODBC driver if you don’t already have one.  A good source for a free driver is the MySQL website.  Look for the MySQL connector for the operating system you have. They have a version for Windows, Mac and Linux you can download for free.  Download one of the packaged drivers that include an installation program.

Setup The Connection

After you have the ODBC driver installed, you need to setup to use it to connect to your MySQL database. How you do that depends on your operating system.

Windows

Open the Control Panel, Administrative Tools, Data Sources (ODBC).  Click on the System DNS Tab and select to Add.  From the drop down select the ODBC driver you just installed.

odbc-connector-setup

Enter the information about your MySQL database, including the server and login information, then press Finish.

Mac

To setup for the Mac, it is similar.  In the Applications/Utilities folder you will find the “ODBC Aministrator” application.  Run that and select the System DNS tab, then click Add.  Select the driver you just added and then enter the login information for your MySQL database.  The form looks just the same as the figure above.

Connecting Microsoft Access to your MySQL database.

After starting Access, either open an existing database or start a new one.  Click on Tables and then click New.  Select the option for a Link Table.   For the File type, select ODBC databases.  Click on the Machine Data Source tab.  You should find the data source you setup in the step above, so select that, then select the table in the MySQL database you want to use.

If you have an existing Microsoft Application setup with a local database, if you export that data to a MySQL database using the same name, delete the table from the Access application, then add the MySQL table, it will use that table for the application in place of the local version you removed.  Your existing reports, queries and forms should work.

Connecting  File Maker Pro to your MySQL database.

Start File Maker Pro and either open an existing database or create a new local one.   Select File, Manage, External Data Sources.  Click on New and then select ODBC.  When you click the Specify button, you should be able to select the connector you setup already.

Conclusion

This tutorial is meant only to get you started  with installing an ODBC driver and making a connection to your MySQL database from either Microsoft Access or File Maker Pro.  Once you make that connection, you can then use the features in your database application with the MySQL table.  It should be noted that once you link the MySQL datbase to Access, it will be treated like a Access table and you would need to use Access SQL statements.  You will also find some limitations with this approach since some functions in Access will not work and some of the features of MySQL will not be available. But for many applications you will be able to work with Access as a front end to your MySQL database.

New Portable Drive

Franz| February 4, 2009 11:04 pm

Previously I did some tests on various internal and external drives.  I just received a brand new Western Digital Passsport Studio drive.  This 500 Gb, 2.5 in, portable drive has three interfaces so I felt it would be a great way to test a comparision between USB2, Firewire 400 and Firewire 800.  I used Drive Genius to do the benchmarking.  It tests four different parameters, but to keep it simple the following charts are only for Random Write.  The green bar is the tested drive and the blue is the standard for a MacBook Pro internal drive.

My tests confirm that the slowest is USB2, followed by Firewire 400.  The Firewire 800 drive was MUCH faster.  Look at the charts to get a feel of how big of a difference the interface makes.  I also include a chart from the prior log entry of the internal 7200 rpm drive.

USB2

USB2 Interface

USB2 Interface

Firewire 400

Firewire 400

Firewire 400

Firewire 800

Firewire 800

Firewire 800

Internal 7200 rpm drive

wd320-internal-randwom-write