You are here: Re: Import .sql file via PHP « PHP Programming Language « IT news, forums, messages
Re: Import .sql file via PHP

Posted by Stephen Harris on 10/16/20 11:17

"Jamie Meyers" <gtg061q@mail.gatech.edu> wrote in message
news:d7e8ge$26g$1@news-int2.gatech.edu...
> Does anyone know how to import a .sql dump file into a mysql database
> using php. I know how to do it using commandline, mysql < test.sql, but I
> am writing an install script, and was wondering if it is possible to do it
> this way. If not, do you know of any parser that will do all the
> importing/table creation the .sql file defines? Any response is much
> appreciated.
>
> Thanks,
> Jamie

I saw these instructions in the install text for PBS, an AMP program.

"Now we put data in our fresh database. In directory pbs/dump is a dump with
example data. Use mysql dbname < pbssample_english.dmp.
(dbname is $db_name in environment.php3)"

I think the dump delivered database structure for a help desk program,
PBS. I don't know much about this so you got "any response".

Another example:
a..
1.. go to the directory where the command mysql is recognized and type the
commands displayed in bold below:
a.. prompt$ mysql
b.. mysql> create database allonto;
c.. mysql> quit
d.. prompt$ mysql allonto < allonto.dmp

1.. Run the following command to dump your Mysql database:
2.. mysqldump -f -t -n >bacula-backup.dmp>


a..

 

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

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