Import CSV file directly into MySQL

Instead of writing a script to pull in information from a CSV file, you can link MYSQL directly to it and upload the information using the following SQL syntax.

To import an Excel file into MySQL, first export it as a CSV file. Remove the CSV headers from the generated CSV file along with empty data that Excel may have put at the end of the CSV file.

You can then import it into a MySQL table by running:

load data local infile 'mine.csv' into table tblUniq
fields terminated by ','
enclosed by '"'
lines terminated by 'n'
(mineName, mineCity, mineComments)

The fields here are the actual tblMine table fields that the data needs to sit in. The enclosed by and lines terminated by are optional and can help if you have columns enclosed with double-quotes such as Excel exports, etc.

How to triple boot

We start by installing Leopard in the whole hard disk.

Then we install rEFIt. To be sure that it was installed roperly and it is activated, we open terminal kai write: cd /efi/refit


Then Finder –> Applications –> Utilities –> Boot Camp Assistant and we choose the partition for our Windows installation.

Many people say that you shouldn’t use BootCamp for “triple boot” but the whole procedure should be done using terminal and diskutil. If you follow this way, windows will stop before they will be installed because they won’t be able to find a proper partition. Why do you think that Apple spent money for creating BootCamp? Anyway, continue installing Windows after creating the partition from BootCamp. When you finish Bootcamp changes the “startup volume”, so keep pressed the button option (alt) from your keyboard and then choose login to OSX.

Open terminal to make sure that Windows did not do something bad and write:

cd /efi/refit


Then Finder –> Applications –> Utilities –> Disk Utility.

Click at the main hard disk, not at the partitions and it will show up tab Partition. With mouse we choose the main partition (OSX), and click at the small sign +. Now we define the partitions size by moving our mouse up – down and we name the partition. Disk Utility will create the partition using HFS+ for filesystem. Do not worry, our Linux distribution will reformat it in whatever you choose (ext3).

To see the space for each partition click on it (it is in GB).

After this you can insert in DVD your favourite distro and start installing it. From rEFIt menu choose to boot from Linux CD/DVD. Using the partitioning tool at the time of Linux installation reformat the proper partition to ext3.

If you have followed everything till now properly, now you must have your disk partitions as following: (1st partition: EFI system, 2nd partition: OSX, 3d partition Linux and last but not least 4th partition with Windows).

BE CAREFULL where you are going to install the BootLoader (/dev/sda3).

Then you have to reboot your system and you will see three options: MacOSX, Linux, Windows.

This is it, without using weird commands from terminal.