Robert -

I created and loaded the tables by brute force. That is, I took each of the CREATE TABLE statements from the mysqldump file and executed them in the phpmyadmin SQL query area and then did the same for the INSERT commands.

Not what I am use too with a dedicated server though :-) !!

I bet it is a filesize problem...I'll look into that.

It appears that I'll have to use the DUMP or SELECT * INTO OUTFILE ... for each table for a backup. Not as convenient as the mysqldump command! Unless I can get the php system() to work.

Many thanks for holding my hand during this learning process....


Robbert van Andel wrote:
Do you have permission to create tables (I would assume so)?  Can you run
any successful queries (i.e. not using the file upload)?  If so, you might
need to check your configuration file, or you might have some file size
limitations, as I mentioned in my previous email.

-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Sunday, November 06, 2005 8:57 AM
Subject: Re: [PHP-DB] Using PHP to import a DB

Robert -

I used the backup file on my desktop computer and the browse button. After the upload was over, I got this message:

Your SQL query has been executed successfully:
The content of your file has been inserted. (sfyc_data_20051105.sql: 11111 Instructions)

However the tables were not created in the DB. I must be missing something simple here!

A sample of the backup file is as follows:

   AC_REF int(11) NOT NULL auto_increment,
   AC_MEMBER_NUM varchar(10) default NULL,
   AC_TYPE varchar(15) default NULL,
   AC_CHANGETIME timestamp(14) NOT NULL,

-- Dumping data for table 'ACCESS'

INSERT INTO ACCESS VALUES (2230,'441','VIEWMEM',20040521111332);

Robbert van Andel wrote:

You could run a system command from the web browser to import the text


If you have access to PHPmyAdmin, you could use it to then import the


Or finally, you should be able to read the contents of the file into a
variable (if it's small enough) and then run the query using mysql_query.

My personal preference is phpmyadmin.  It's a very good database interface
and can be retrieved from

Robbert van Andel
-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM
Cc: Chris Herron
Subject: [PHP-DB] Using PHP to import a DB

My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate "mysql -u user -p db < /tmp/mydb" with php?

Any suggestions are greatly appreciated....


PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to