RE: Using PHP to import a DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, this is an upload of a local file.  I'm not sure if there is a way to
run the sql command inside the file if it's sitting on the server.  Keep in
mind that you may run into size upload restrictions (i.e. files larger than
2 megs, or whatever your webhost has set it to).  If that's the case, you
can separate out the sql commands from the file into separate files.  

-----Original Message-----
From: Todd Cary [mailto:todd@xxxxxxxxxxxxxxxxxx] 
Sent: Sunday, November 06, 2005 8:43 AM
To: php-db@xxxxxxxxxxxxx
Subject: Re:  Using PHP to import a DB

Robert -

I installed phpmyadmin on the shared server, however I am not sure of 
the command to run the sql file, mybackup.sql, that was created on the 
dedicated server with mysqldump.

The docs as best as I can read them indicate that all I need to type 
into the "Run SQL query" text box is the name of the file 
("/tmp/mybackup.sql"), however that produces an error.

Maybe the problem is that I FTP'd the file to the shared server and it 
should be on my local computer??

What have I overlooked?

Todd

Robbert van Andel wrote:
> You could run a system command from the web browser to import the text
file.
> If you have access to PHPmyAdmin, you could use it to then import the
file.
> 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 http://www.phpmyadmin.net/home_page/
> 
> Robbert van Andel 
> 
> -----Original Message-----
> From: Todd Cary [mailto:todd@xxxxxxxxxxxxxxxxxx] 
> Sent: Saturday, November 05, 2005 4:02 PM
> To: php-db@xxxxxxxxxxxxx
> Cc: Chris Herron
> Subject:  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....
> 
> Todd
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux