Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Data Import From Text File


When I try to import a text file with new data for an existing
table I get the error "1148 - the used command is not allowed
with this MySQL version."

I have tried with both PHPMyAdmin2.3 and with MySQLFront 2.5.
Both these GUI programmes have an "import from text file" command
which I have used successfully several times to add entries to
this table before - running just this MySQL version. I have
structured the data in the text file in just the same format as
previously.

Both these programmes are connecting to the database successfully
now and will display the contents of the existing table data and
strcutre of the database etc (despite an earlier connection
problem which seems to have been solved spontaneously).

But both now deliver exactly this error message (and therefore I
assume it is MySQL and not the interface programmes which is
doing it).I cannot see that I am doing anything different.

I have MySQL 4.0.12 on Windows ME PC with a local Apache server
and PHP.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Problem With Data Import From Text File
When I try to import a text file with new data for an existing
table I get the error "1148 - the used command is not allowed
with this MySQL version."

I have tried with both PHPMyAdmin2.3 and with MySQLFront 2.5.
Both these GUI programmes have an "import from text file" command
which I have used successfully several times to add entries to
this table before - running just this MySQL version. I have
structured the data in the text file in just the same format as
previously.

Both these programmes are connecting to the database successfully
now and will display the contents of the existing table data and
strcutre of the database etc (despite an earlier connection
problem which seems to have been solved spontaneously).

But both now deliver exactly this error message (and therefore I
assume it is MySQL and not the interface programmes which is
doing it). I cannot see that I am doing anything different.

I have MySQL 4.0.12 on Windows ME PC with a local Apache server
and PHP.

PS I sent a long message about this and a connection problem
yesterday which was not succint enough.

Import Data From Text File Mysql
Im going to write a script in linux that updates my mysql database. How can i write a sql statemtn that updates my mysql table from a text file located on my machine?
lil confused bout the path of the txt file?

LOAD DATA INFILE Command To Import A Text File
I am using the LOAD DATA INFILE command to import a text file into
mysql.

However, there is much more text in the file than needed in my tables.
How can I make a selection from the text line. For example position 5 -
10 in field A, position 20-23 in field B, etc ...

How To Import Text File?
I am using MAMP and am trying to import a large text file (up to 30mb) that is defined by position i.e., space 1-8 = ID, space 9-14 = Description, etc. The only option for import is via SQL or CSV file.

Text File Import
I'm importing a large text file (8 million lines) into a mysql table via the heidisql front end. Each line has 42 fields (tab separated) so there's a lot of data to bring in.

I tested the import with a truncated version of the text file (10,000 lines) and the import worked fine. It took about a minute (i think) to import. Now though, the full version (which is 800x as long) has been importing for nearly 48 hours. Heidisql seems to be still working - it hasn't frozen, it's busy.

Is it normal for a file of this size to take so long to import?

Import A Text File
I have a utf8 txt file to import in a MySQL db, cause I must create a
web-application in PHP for reading this information on-line.
I have create a new DB in MYSQL 4.1.1a setting CHARACTER=utf8,
then I have create a table t1 with character set utf8 and some fileds
also with CHARACTER=utf8.
Then I imported the Txt file (really in UTF8 format, with 22600
records!) in my db. MySQL have imported the non-utf8 field correctly,
26000 records.
When I try to read this utf8 filed they appear like "???-?-???".
Then, also my PHP application show this field with stranges
characters. I have try also with PHPfunction utf8_encode with no
success

Import Text And Csv File
i want to import either text or csv file to database how can i do this..i have tried mysqlimport command but its giving some error

MySQL Import Text File Too Big?
Our production database in an exported textfil runs about 60 MB.
Compressed that's about 9 MB.

I'm trying to import the export into another machine running FC3 and
mySQL 11.18, and it appears as though the file may be too big!
When I try to do it via command line:

mysql -u root --host=localhost printing < ./printing.txt

It eventually errors out with a "syntax error on line X" and only about
half the tables get imported, and MyPHPAdmin GUI interface says it has
a 2MB file limit on importing.

This concerns me. If something were to happen to our production
database, how am I going to restore it?

I tried to do a search on mysql.com, but that's a less than helpful
site for support. A newsgroup search on the topic didn't come up with
much, so maybe I'm just bad at using keywords.

Error In Mysql Import (text File)
Error

SQL query:

-- phpMyAdmin SQL Dump
-- version 2.8.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 27, 2006 at 12:21 AM
-- Server version: 4.1.18
-- PHP Version: 4.4.2
--
-- Database: `lopata_trnew`
--
-- --------------------------------------------------------
--
-- Table structure for table `Register`
--
CREATE TABLE `Register` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`Date` date default NULL ,
`Name` text,
`Company` text,
`Address` text,
`City` text,
`State` tinytext,
`Zip` text,
`marketarea` text,
`Phone` text,
`Email` text,
`Comments` text,
`OwnerNameA1` text,
`OwnerNameB1` text,
`PropAddr1` text,
`PropZip1` text,
`OwnerNameA2` text,
`OwnerNameB2` text,
`PropAddr2` text,
`PropZip2` text,
`OwnerNameA3` text,
`OwnerNameB3` text,
`PropAddr3` text,
`PropZip3` text,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =49;

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 '

CREATE TABLE `Register` (
`id` int(10) unsigned NOT NULL auto_increm' at line 1

Import Structured Text File Into Mysql
I've a lot of structured files like the following one I would like to import in a mysql database:

Message-ID: <417ee59f@mail-ha1>
Subject: test
From: renu [renu@solicomm.net]
Newsgroups: Practice

<html>
<head>

</head>
<body>
<p>
xghdgdfgfgdff
</p>
<p>
xgdsfssdfsdf
fsdfsfsdfhdgdfgfgdff
</p>
</body>
</html>

I need to import the first 4 rows in 4 columns (messageid, subject, form, newsgroups) and the last part of the text, which is in html, in a 5th colum.

The fact is that I'm not sure whether it's possible.
Should it be possible, could someone point me to the method/tool that could help me in doing that?

Trying To Import A Text File That Has A Non-standard Encoding
I have written a applicaiton that reads in a text file and then parses each line to store a record in MySQL.

I'm having problem with only this one file where when I open with notepad, there is no new line and instead the line breaker character is replaced with a number like 105788, 105704, 105708, and so on (its not the same number for each line)

However, when I open this same file with wordpad, the new line shows correctly. I was wondering if anyone can point out some suggestion as to how I can effectively import this file. Currently, my application is dependent on the fact that each field is seperated by a new line.

Can't Import More Than 3932 Recs From Text File
I am sure mysql can handle a larger import than this !

Any ideas why this should occur - it always fails around the same place - but not at a specific record (rec 3932,3930,3931).

Need To Insert Data From A Text File Into A Medium Text Field.
How can I go about inserting data into a MEDIUMTEXT field from an existing text file using Java.

Import Data From A Binary File
I have a binary file that contains data that was exported from Microsoft SQL. I have the details regarding the various columns that are contained in the file.

I am not sure if MySQL can actually import the data from such a file and load the contents in a table in a text format. Currently this is the only way that the person I am dealing with can provide the data.

Import CSV File With Numeric Data
I am trying to import a CSV file which was exported from another mysql database with comma separation and quote delimeters.  A numeric column is enclosed in quotes and cannot be directly imported into the target table since it is now a string.

How should I import this data?  I have tried to import it to an intermediate table with the id column defined as a varchar but I have been unable to convert that value back to a number.

Import Data From .txt File Into MySQL Table
i have text files which are generated daily and stored in a folder on the C: drive. I was wondering what would the mySQL command be to import that data into a mySQL table. The text file does not have a header with the field names so would i have to make that table first with the desired columns?? Also, does the file have to be in the databse directory or can it be anywhere on the machine??

Import Data Form Txt Or Cvs File Format
I have a fully installed version of MySql Server 5.0 including MySql Administration, MIGRATION Tool, Query Browser and System Tray Monitor.

I have lots of Data stored in a txt File. I do not want to type them all in. How do I import Data from a txt or cvs File format? They are standardizes.

Transfer Data To Text File
I need to transfer data from a table to a text file. I do not know how to get started.

Inserting Data From Text File Question
I have a sql table with about 9 fields of data in it.The first 3 are filled and the last 6 are currently blank. I have a tab delimited .txt file containing data for each of the 9 fields and want to import it in phpmyadmin to both overwrite the existing data in the 3 fields and fill out the other 6.

However I only want to import the data where one of the existing filled-out fields "TournamentID" equals 10. But I'm unsure how to do this. Will this work?:

SELECT * FROM `tbl_finish_pos` WHERE TournamentID=10
then check every row returned and select the Import tab in phymyadmin to insert the .txt file

Loading Data Into A Table From A Text File
I have a table in MySQL with the columns: "ID, JokeText, JokeCategory, JokeDate"

I want to take a text file that is a long list of jokes, and load each joke into a new row of the table in the JokeText field.

I have tried a bunch of different approaches, and just can't get it to work right. Can anyone enlighten me?

If it helps, here is a sample from the jokes text file (yes, they are stupid :P)

Q: What goes up and down but does not move? A: Stairs
%%
Q: Where should a 500 pound alien go? A: On a diet
%%
Q: What did one toilet say to the other? A: You look a bit flushed.
%%
Q: Why did the picture go to jail? A: Because it was framed.
%%
Q: What did one wall say to the other wall? A: I'll meet you at the corner.
%%

Insert File Data Into Text Field
I've built a database locally and have inputed some information. I
need to go back and update some records, specifically by taking long
pieces of text and putting them into text fields.

Cutting and pasting in the command prompt for windows isn't such a
good idea. Is there a way to update an existing record by importing a
text file into a text field?

All the info I'm seeing in the MySQL manual and in these groups is for
importing text-deliniated files.

Export Copy Of All Data From Field To Text File..
I would like to export a copy of the contents of one of the fields in my DB to a text file, that I can then access via my normal telnet account.

Any ideas on what commands I could use to do this? I've read some of the posts and they refer to "dumps" so maybe this is what I need?

Importing Data Via Text File. Size Limit!
I am running mysql/php on my local machine (xp-pro). I am trying to import a lot of data into the database. I have about 50 thousand records. Here is a example of a recordset.

"13-01-103-007","32835 BRUGGEMAN","Warren Consolidated","95380","95380","94160","100.000","60.000","120.000","0.165","0","0","Apartment ","0","1.00","1307","C ","Brick ","1626","399","2","1626","1.00","0","1","1 Story","1980","A "

The fields are seperated by "," and enclosed by " "" ".
When I use phpmyadmin and limit the insert to about 30 records every thing works fine. But when I try to do the entire batch (50,000) it times out or I get a generic error "page can not be found" .

I noticed in phpmyadmin that the limit of file size is 2048kb. Could this be the problem? If so can I increase the size of the file? Mines is 14.9 MB. Or not have it timed out.

Converting Mysql Data Base Into Text File
how can i convert mysql database into text file ,is there any way to do such conversion (if possible) using php script.

Facing Error While Restoring Binary Log Data From A Text File
I took the backup of my binary log file "dev02-bin.000003" as "binlog000003.txt" at the location "/backup" directory with the help of the command

shell> mysqlbinlog "/var/lib/mysql/dev02-bin.000003" > /backup/binlog000003.txt

Also now i deleted the original log file i.e "dev02-bin.000003" from the "/var/lib/mysql" directory"

Now i tried to restore the same binary log file from the text file "binlog000003.txt" with the help of the command

shell> mysql -p < /backup/binlog000003.txt

after running this command i am getting the error

ERROR 1062 (23000) at line 21:Duplicate entry 'v9jfud8bkhjm8v19kqu3dhujq0' for key 1

Insert Text File In A Text Field
2 questions:

1) How can I insert a text file into a TEXT field (of a table)
by a mysql instruction ?;

2) How can I insert a microsoft word file into a BLOB field (of a table)
by a mysql instruction?

Import From Text
I have a text file which contains names and dates. the date is in the format
Sep-11-2001 12:30 AM.
I tried to put the text into Excel and then used Navicat to import from Excel.
But everytime the dates are converted to 1/1/2001.

Text Import
I need to append records from an Excel spreadsheet to an existing table. I think I should start by converted the Excel sheet to a text file then importing from there. I have to do this using myPHPAdmin. Am I on the right path and how do I start and import using myPHPAdmin?

CSV Import When There Are Commas In The Text?
I'm trying to grab a csv file from a remote server and import the data my mySQL DB.

I'm using Curl to grab the file contents and php to import the data into my DB.

The problem have is that the data in the csv file contains commas in the text field that is interferring with the import and I have no control over what is in the file.

eg the csv looks like:

id,name,description1,description2,date
1,pete,"this has a comma, in the text", "this also has, a comma", 2004-09-09
etc, etc
The additional commas mess up the import. Is there any way I can get this data into mysql and just tell it to ignore any commas in certain fields?



Import CSV, Text Files
how to automate the import of CSV, text files into MySql?

Import A Text Backup Of SQL Db Into Another One On Linux
I have a SQL file, which is a backup of a database (data+scheme).
The file was generated using MySQLGUI backup features on a windows 2k3 server.
Now I would like to import this data + scheme into a mysql server running on linux, there is no GUI on the machine.

2 questions if I may:

1. How do I import the described above data.
2. Will the meta data (permissions, collation & co.) will be restored as well, or will I need to reconfigure them ?

Import A .sql File
Ok, probably any easy task but not having much luck here. i exported to an .sql file a database from phpmyadmin. now, what i want to do is use that file to recreate the database on my local test machine. i do not have phpmyadmin installed on this system, so am looking for the proper query i can use at mysql command line to run.

Import CSV File
I should import a csv file into mysql table, so i write:

load data local infile <file name>
into table <Table name>
fields terminated by ','
enclosed by '"'
lines terminated by '
';

However, I find that it is time consuming for writing the query "fields terminated..............by '
'"
since I should import the csv many time.

So can I modify the default value of "fields terminated by" so that I could omit that part when I import the file?

Import .sql File
I am working with mysql for the first time. I figured I would try to learn a little about it by creating a Cacti SNMP monitoring server. I have created a database in mysql called cacti. The root password is also cacti. I have been fighting with importing the included cacti.sql file for days. I have tried multiple syntaxes and get the same error everytime. Here is what I have done:

mysql> mysql -u root -p cacti cacti < c:inetpubwwwrootcacticacti.sql;
ERROR:
Unknown command 'i'.
Show warnings disabled.
ERROR 1064 (42000): 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 'acti.
sql' at line 1

I am sure this is a stupid mistake because everything I read makes it sound like importing .sql files is easy.

Import Sql File Into PhpMyAdmin
I am trying to import SQL file which contains Structure & data into PhpMyAdmin locally and i get error message:

You have an error in your SQL syntax near 'ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=latin1' at line 14

The file size is about 1.95 MB. The file was exported through SQLyog as SQL Statements and the following fields were ticked:

-Include "USE dbname-" statement
-Include "DROP TABLE" STATEMENT
-Add "CREATE DATABASE"
-Lock All Tables For Read
-Create Bulk Insert Statements

The fields left unticked are:

-Flush Logs Before Dump
-Add Lock Around Insert Statements
-Set FOREIGN_KEY_CHECKS=0

Don't know much about MySQL, any help would be much appreciated.

Import CSV From String, Not A File
does anyone know if it's possible to import "geek@geeksupport.com,test@example.com,abc@example.com" into a temporary table with 1 field into mysql? This will be coming from a webpage, not a file.

I know I can chop it in php and do an insert on each email address, but hoping if there's some kind of built-in mysql to do this.



How To Import The Dumped File?
I have a mysqldump exported file( with structures), now I need to import it to a new database.

I learned about mysqlimport, it seems that it only support single table. but my dumped file have all the tables of a database.

Fastest Way To Import A *BIG* .sql File
i've a big file with sql stataments: it's about 35 GB (about 2 GB if zipped).

What's the fastest way to import it into mysql? Is there a way to import it from the zip/bzip2 file?

Import Txt-file To Mysql DB
On the one hand i have a mysql-table called "news". It has 4 fields, "uid" (with auto_increment attribute), "headline", "text", "author". On the other hand i have a txt-file in the following format.

headline|text|author
This file contains of several lines, all in the same format.
Is it possible to import this file to my database? I need the "headline" from the txt-file in my "headline" field and so on.. The uid-field has the attribute auto-increment, so i think i must not care about it, right? I tried some things but they didn't work.

Import Into A Table With A File
Our Database server has moved off of the local machine and is by itself. When I try to run:

load data local infile '/Users/test/Documents/CC.txt' into table bi_kinkead.new_macbook;
test.reseller_cc

I get an error because the file is not located locally. It is locaed on a server called Pluto. What is the formating to use so I can get this file imported?

Import Fixed Lenght Field From Ascii Text
does anyone have some suggestion to import Asccii text into Mysql tables

The tables are empty and can be created at import
The records from ascii text are fixed lenght but delimited by CRLF

The fields are not delimited but fixed lenght

Import A Directory Of Text Files Into A Mysql Database With Php?
I have a directory of text files that i'd like to import into a msql
table... I was wondering if there's an easier way to do this with
php/mysql, I'd like to avoid copy/pasting the entire directory
(thousands of files) into the database if i can.

The directory structure of the text files resembles...

somepath/A/Aerosmith/Song Name.txt - (extention varies)

What i'd like to do is use php to scan the directory and input
the file path information and the content from each file into a table
like...

Dir Artist Song Text Type
------------------------------------------------------------------------
A Aerosmith Song Name Fa La La La La (example text) File Ext
B Beatles Song Name Fa La La La La (example text) File Ext

Schedule Auto Import New Log / Text Files Into MySQL
Basically we have a SQL Server Database on our telecoms switch, to which under the maintenance contract we have no direct access. Every 15 mins log files are downloaded in *.log files (text files) which contain data we can upload to our own databases for querying. The log files are on an ftp server and the filenames comprise of date and time of dumps.

Requirement :

In short I would like to know the best way to automatically update tables on a MySQL database with the new log files as they appear or if there is some existing software which allows this type of schedule and auto import.

I would be very greatful if someone can give me some ideas with this problem as it would save me so much time and I am most familiar with mySql and Sql Server databases and would appreciate help in either database.

LOAD DATA INFILE To Import Data Exported From A MS Access Xp
I am trying to use LOAD DATA INFILE to import data exported from a MS Access Xp table. But all i get in the date field is 00:00:00, as Access exports DATE and TIME and MySQL seems to use just the TIME portion of this.

Is there any way to ahve MySQL import just the DATE portion or is there any way to have Access export only the DATE portion?

Sql Code To Import File Locally
I want to import a file to create tables in a database on my machine from command prompt, I have done this beofre but a long time ago, I have put the file in the bin folder of the MySql directory, i thought the code was something like ..file.sql

Can anyone tell me what it should be.

Import .xls File Into A Mysql Database
I have a .xls file that i would like to import into a mysql database, I am ok creating the mysql table in phpmyadmin on my webspace but i cant work out or find any useful tutorials on how to import the database from the .xls format and get it into the database short of building a form and submitting by hand which would take far to long.



How Do I Import .csv File Into My Mysql Database?
I woould like to know how to import csv files into my mysql databse, I tried the:

LOAD DATA LOCAL INFILE '/importfile.csv'
INTO TABLE test_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY ''

Commands but I dont know where would i put these command and wher do put the "importfile.csv", what directory and location?

Import Excel CSV File Into MySQL
I have used MySQL for little while now but I have never had to import directly from a csv file.  I went to MySQL docs and thought I found the solution but it gives me an error. The csv file is in Excel format and has the first line with headings.  Here is the SQL statement that I tried but doesn't work:

LOAD DATA INFILE './List.csv'  INTO TABLE lsi_mailer (ListDate, ExpDate, Company, Address, City, State, Zip, DPBC, CR, County, Phone, Salutation, LName, FName, Title, Gender, Worksite, BType, SIC, SICDesc, BranchCode, ProdDate, MailDate)
FIELDS TERMINATED BY ','
LINES TERMINATED BY '
' ;

The files List.csv is in the MySQL data directory.  If I take out everything after the fields it seems to work but the data does not seem to import.

Import Only 1 Database From A Mysqldump File
i like to import only one Database include 37 Tables from a dumpfile. But i must be shure that only this one Database is imported. The dumpfile include more Databases (70) with >1500 Tables

Can i use this --database=onlyforum option for mysql ?

mysql -hlocalhost -uuser -p --database=onlyforum < alldatabases.sql

ore is there a other option to use?


Copyright © 2005-08 www.BigResource.com, All rights reserved