PDA

View Full Version : Inserting data from a text file


Mr. Dog
10-24-2002, 10:42 AM
I'm trying to insert several hundred email addresses into a MySQL DB for a mailing list. When I try to insert from a text file via PHP Admin, I get an error that says the used command won't work. Why is this? What, if anything am I doing wrong? What is the proper syntax/format for the .txt file?

Any help is 100% appreciated.

Mr. Dog

sylow
10-24-2002, 11:09 AM
Welcome Mr.Dog first of all.
You should check mysql.com for how you can import data into mysql. There is more than 1 method to do that, one if offcourse CVS and other one is executing insert statements from a sql file.
Can you give me lines from your text file and your database schema? so I may give you more precies answer.

mzenner
11-18-2002, 09:45 PM
I think i have a simular problem,
when i try to upload a .sql file (5MB) i get the error: No sql queri

i'm sure everything in the file is ok (it is a mysql dump and cause i tried all parts of the file uploading in small parts and they work ok )but it seems phpmyadmin has troubles getting a larger file (i mean 5mb isn't that large but ..)(i'm now on host 41)

part of the file:
# phpMyAdmin MySQL-Dump
# version 2.3.1
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generatie Tijd: 18 Nov 2002 om 08:04
# Server versie: 3.23.43
# PHP Versie: 4.2.2
# Database : `prietpra_studforum`
# --------------------------------------------------------

#
# Tabel structuur voor tabel `gb_forum_auth_access`
#

CREATE TABLE gb_forum_auth_access (
group_id mediumint(8) NOT NULL default '0',
forum_id smallint(5) unsigned NOT NULL default '0',
auth_view tinyint(1) NOT NULL default '0',
auth_read tinyint(1) NOT NULL default '0',

... HOW can i solve this, or how can i upload my file?

Gijs
11-20-2002, 02:12 AM
Hi,
Think the php.ini on HR is limited to 2 or maybe 4 MB.
Simply chopp up your .sql dumps in to smaller files and load them up seperately.

HIH,

Gijs

mzenner
11-20-2002, 02:18 AM
I got great help from the hostrockethelpdesk, they said the best way to solve that problem was: upload the SQL file to your account (ftp), and use the command line to load the file.

I did it and it worked great for me,
If you need SSH access, you can send a ticket and they will activate it for you

greetz mz