Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001041

RE: [PHP-DB] Transferring tables From: Francois Legare (flegare <email protected>)
Date: 04/14/01

I don't know how to output the database structure and its data to a file
from an sql query BUT i know that using PhpMyAdmin will do the trick for
you. You'll find a function "view schema" in the main page (select the
"structure and data"). It dumps all the sql necessary to recreate your
database and reinsert all the data - you can then reuse the text either in
phpmyadmin or inside the mysql client to recreate the db and its data.

http://www.phpwizard.net/projects/phpMyAdmin/

You can also simply copy the directory that corresponds to your db under the
mysql data directory, if that's possible for you to do.

Francois Legare
flegare <email protected>
Vancouver BC Canada
604.261.1320

> -----Original Message-----
> From: Mick Lloyd [mailto:mjl <email protected>]
> Sent: April 14, 2001 5:23 AM
> To: Database Help PHP
> Subject: [PHP-DB] Transferring tables
>
>
> I've set up a database (with tables completed from user forms) offline and
> want to transfer tables to a replication of the database online to save
> having to re-enter all the data through the input forms.
>
> I've tried connecting to localhost and issuing the following commands with
> the intention of outputting to a file then loading from that file. Neither
> of the following work:
>
> Connected to local:
>
> $resultlocal = mysql_query("select column_names into outfile
> 'http://www.mydomain.com/..path to.. /file_name.txt' from table_name") or
> die(mysql_error());
>
> Error = "Can't create/write to file ...
>
> The alternative, connected to remote:
>
> $resultremote = mysql_query("load data infile
> 'http://localhost/file_name.txt' into table_name") or die(mysql_error());
>
> Error = "Access denied for user: 'root <email protected>' ...
>
> Do I need to fiddle with the paths, or am I going about this in completely
> the wrong way?
>
> Regards
>
> Mick Lloyd
> mjl <email protected>
> Tel: +44 (0)1684 560224
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>