Re: Import .sql file via PHP




"Jamie Meyers" <gtg061q@xxxxxxxxxxxxxxx> wrote in message
news:d7e8ge$26g$1@xxxxxxxxxxxxxxxxxxxxxxx
> 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..


.



Relevant Pages

  • Re: [SLE] mysql and php
    ... I did see it - it's pretty odd that it doesn't include mysql. ... no php web page works at getting to the mysql database. ... I can get to it by command line, create databases, ... If you opt to install development tools, ...
    (SuSE)
  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)
  • Re: ruby on rails with mysqladmin
    ... mysqladmin -u root create dummy_development ... mysql -u username -p ... You can try to do it all in one command line, but it's really a lot easier to do it one step at a time. ... to create a database you should use: ...
    (comp.lang.ruby)
  • Re: openOffice Php MySQL
    ... the number of movies initially displayed. ... And, with the new column, the command to create the table is here: ... However, first you'll need to create a database so, while you have the ... MySQL doesn't know you've finished it. ...
    (alt.os.linux.suse)
  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)