Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


Hello

It doesn't really look like you are importing into Base as much as MySQL.
Have you tried this...

In phpMyAdmin, click the table, and then click the Import tab at the top of the page.

Browse and open the csv file. Leave the charset as-is. Uncheck partial import unless you have a HUGE dataset (or slow server). The format should already have selected “CSV” after selecting your file, if not then select it (not using LOAD DATA). If you want to clear the whole table before importing, check “Replace table data with file”. Optionally check “Ignore duplicate rows” if you think you have duplicates in the CSV file. Now the important part, set the next four fields to these values:

|Fields terminated by:,Fields enclosed by:“Fields escaped by:\Lines terminated by:auto|

Currently these match the defaults except for “Fields terminated by”, which defaults to a semicolon.

Now click the Go button, and it should run successfully.

From: http://stackoverflow.com/questions/9734486/importing-a-csv-into-phpmyadmin

Open your CSV to be sure that it matches these rules.

I haven't done this myself, hope this helps though.




On 1/20/2016 6:05 AM, Ian "Witty" Whitfield wrote:
Hi All

I have been trying to import a CSV file from Calc into MySQL to run with Base for over a week now and can not believe this is so difficult to do so I'm hoping some other Base users might have cracked this one!!

My OpSys is PClinuxOS - 32-bit and MySQL is ver 5.1.73. Everything is running on localhost.

My CSV file is in Calc and has 2600 rows and 78 cols. I save it as a CSV file which is 717.8Kb in size. Field Names are in row 1.

I have tried many times with phpMyAdmin with no luck and today I installed MySQL Workbench - also no luck.

In all cases I get the error ...

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(10), `NULL` varchar(10), `NULL` varchar(10), `NULL` varchar(21), `NULL` ' at line 1

MyAdmin seems to stop after only 38 fields and the error does not show the field names in the error. Also it is not MY SQL syntax it is MyAdmin's syntax!!

Workbench says - ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RecordID,Status,StatusGraphic,Title,PrefFirstName,FirstName,LastName,Maiden/Form' at line 1
Operation failed with exitcode 1.

Can anyone help me out please. I'm NOT a Database expert just a user and must get this DB up and running again ASAP!!

Many, many thanks

IanW
Pretoria RSA



--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.