View Single Post
  #4 (permalink)  
Old December 16th, 2003, 02:54 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

phpmyadmin makes things pretty easy if you want a PHP-based solution. However if you are looking for a command line solution to work directly with the MySQL server you could read the MySQL manual entry for the mysqldump utility which shows the syntax for importing SQL from an external file.

Quote:
quote:From: http://www.mysql.com/doc/en/mysqldump.html

The most normal use of mysqldump is probably for making a backup of whole databases. See section 4.5.1 Database Backups.

mysqldump --opt database > backup-file.sql
You can read this back into MySQL with:

mysql database < backup-file.sql
or

mysql -e "source /path-to-backup/backup-file.sql" database
hth,
: )
Rich



:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote