Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/content/d/e/d/dedic83d/html/includes/joomla.php on line 2826

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/content/d/e/d/dedic83d/html/includes/joomla.php on line 2927

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/includes/joomla.php on line 699

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/index.php on line 226

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/index.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/index.php on line 228

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/index.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/e/d/dedic83d/html/includes/joomla.php:2826) in /home/content/d/e/d/dedic83d/html/index.php on line 230
UNLIMITED DYNAMICS - WEB | PHOTO | WRITE | DESIGN - How To Export From One MySQL Database And Import Using phpMyAdmin And A CSV File
Advertisement
How To Export From One MySQL Database And Import Using phpMyAdmin And A CSV File
Software - MySQL phpMyAdmin
Wednesday, 25 July 2007
Here's a good one. Sometimes in the course of performing administrative duties on a MySQL database, using phpMyAdmin, you are required to import and export data. And sometimes, when importing using simple text files (.txt / .sql), the import doesn't go so well. Or, perhaps you're looking to simply export data from a MySQL database to another database after modifying the data using Microsoft Excel or Open Office Calc and converting it to Comma Separated Value (CSV) and importing it using the .CSV file. Well, there's hope.

First, began by exporting the data from your MySQL database phpMyAdmin tool. Using phpMyAdmin, export your required data, making the selection to export as a CSV file. Next, open the database CSV file. Using Open Office Calc seems to be a be easier software application to use here, since when opening the file, the program automatically requires you to filter the delimiters, but that's another article for another day. Now, remove the headers from the generated CSV file. If there is any empty data, delete it.

Being that we have that out of the way, copy and paste the following query into the SQL query window.

LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [your-table-name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);

The file you are importing is "your-file.csv" and the table you are importing into is "your-table-name." The enclosed by and lines terminated by are optional but can assist you should you have columns enclosed with double quotes, which is standard when exporting from Excel, which is amid a few reasons why you may want to use Open Office.

MEDIA TAGS:  mysql phpmyadmin php sql dba rename table name tables query queries CSV excel open office
 
< PREVIOUS
Fix The Virtuemart Cookie Check &vmcchk=1 Error Warning And Redundant SEF URLs

The cookie session check in Virtuemart E-Commerce Shopping Cart Software Component within the Joomla Content Management System (CMS) may serve a purpose but creates some...
+ THE COMPLETE STORY

VirtueMart Category Browse Page And Product Flypage Tags List

The Virtuemart E-Commerce Shopping Cart software solution offers two primary pages within its product category and product page structure. Within the Virtuemart product...
+ THE COMPLETE STORY

Joomla / Mambo Templates Front End Preview Module Positions URL index.php?tp=1

When developing or modifying custom Joomla Templates, Mambo Templates and Virtuemart Templates, being able to quickly referece the various module positions available...
+ THE COMPLETE STORY

UNLIMITED DYNAMICS Web Site Template Design Complete

After diligently tending to the demanding surge of new and on-going client projects throughout the months of September and October, the UNLIMITED DYNAMICS.com website...
+ THE COMPLETE STORY

MORE UNLIMITED NEWS

WEB SITE DESIGNERS / DEVELOPERS -- E-COMMERCE | SHOPPING CARTS | ONLINE STORES | PORTALS | CONTENT MANAGEMENT SYSTEMS | CMS | BLOGS | SOFTWARE | PHOTO GALLERIES
JOOMLA | DRUPAL | VIRTUEMART | WIKI | GALLERY2 | MAMBO | PHP-NUKE | MYSQL | SMF | phpBB | vBULLETIN | XOOPS | WORDPRESS | b2EVOLUTION | osCOMMERCE | ZEN CART | COPPERMINE
PHOTOGRAPHY / PHOTOGRAPHERS / PHOTOJOURNALISTS -- PORTRAITS | PRODUCT | PHOTOJOURNALISM | EVENT | LOCATION SCOUTS | MOTORSPORTS | ARCHITECTURE | AERIAL | WEDDING
COPY WRITING / WRITERS -- PRESS RELEASES | SLOGANS | PRODUCT RELEASES | ADVERTISING | TECHNICAL | FEATURES | NEWS | SYNDICATION | EDITORIAL | NEWSLETTERS | CATALOG | SEO
PRIMARY LOCATIONS -- HESPERIA | APPLE VALLEY | VICTORVILLE | PHELAN | HIGH DESERT | ONTARIO | RANCHO CUCAMUNGA | INLAND EMPIRE | SAN GABRIEL VALLEY | PASADENA
LOS ANGELES COUNTY | RIVERSIDE COUNTY | VENTURA COUNTY | SOUTHERN CALIFORNIA | NEW MEXICO | COLORADO | BAJA CALIFORNIA | NEVADA | MOUNTAINS | DESERTS
OFF-ROAD | POWERSPORTS | UTV | ATV | QUAD | SIDE-X-SIDE | DIRT BIKE | STREET BIKE MOTORCYCLE | 4X4 | ROCK CRAWLING | ROCK CRAWLER | PRERUNNER | TRANSAMERICAN WHOLESALE
| KEYSTONE AUTOMOTIVE | TUCKER ROCKY | PARTS UNLIMITED | 4WD | 4 WHEEL PARTS | FOUR WHEELER
WEDJ