You are here: Re: Back up mysql db from shell « PHP Programming Language « IT news, forums, messages
Re: Back up mysql db from shell

Posted by Andy Jeffries on 05/09/06 11:22

On Tue, 09 May 2006 00:35:55 -0700, apostolosl wrote:
> $command="mysql --host=$host --user=$user --password=$pass
> --database=$db;";
> system($command);
>
> , where $host, $user etc are being set at the top of the page. This works
> fine and I get connected to the remote database.
>
> Now I need to run the following mysql command: source stb_products.sql

That's where you're going wrong. What you want to do is:

$command="mysql --host=$host --user=$user --password=$pass
--database=$db < stb_products.sql";
system($command);

Cheers,


Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация