The mySQL command should read : mysql -u username -p[password] db_name < dumpfile
Note that you can give the password on the command line but it is best to get into the habit of just providing -p and typing in the password when prompted. BTW, when doing the mysqldump for tables that already exist in the destination database use --add-drop-table this will effectively drop the existing table before importing the new data. Coz On Wed, 9 Feb 2005 17:52:52 +0200, Paul Godard <[EMAIL PROTECTED]> wrote: > > > >The piped mysqldump can work in either direction as mysql will also > >accept a host parameter and php can run shell commands. However, I > >guess your firewall could be an issue if it prevents connections to > >the mysql port. > > > >There was a thread I believe on the PHP list about doing a mysqldump > >and emailing the dump file and then processing that dump file on the > >recipients box. > > Thanks again > > I couldn't find the thread but I manage to save the dump file on my > local server (at the same location as the php script) by running a > mysqldump on my local server to fetch a table on the web server. > > mysqldump -h server_ip -u username -p password db_name table1 > filename.sql > > However I couldn't manage to create and insert data on the local > server (the table1 being not there of course). I mean the part below > didn't work. > > > mysql -u localuser -p local password db_name > > I also tried to run mysql directly but with no success. > > mysql -e "source filename.sql" db_name > > or > > mysql db_name < filename.sql > > However the operation worked via phpMyAdmin (read text file) directly. > > My conclusion is the firewall is not a problem but for some reason > the syntax of the read dump part is not correct... > > Any idea why? > -- > > Kind regards, Paul. > > Gondwana > [EMAIL PROTECTED] > http://www.gondwanastudio.com > -- CozWeb Solutions Ltd http://www.cozweb.net -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]