Re: Import .sql file via PHP



Anonymous пишет:
Jamie Meyers wrote:

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


If you know how to do it with a commandline what's wrong with
exec("mysql < test.sql"); ?
can be denied on public hostings!
.



Relevant Pages

  • Re: storing root password rpm spec file
    ... Actually, if you really want/need to go that way, and you know the rpm ... will only be installed from the commandline where the scripts can prompt ... then you can just use 'mysql -u root -p' and mysql itself ... will prompt for the password. ...
    (Fedora)
  • Re: How to delay execution in /etc/rc.local ?
    ... Cyde Weys wrote: ... > mysql with the user and password from the commandline it works fine. ... Murphy's law. ...
    (alt.os.linux)
  • Re: [SLE] Uninstall MySQL Cleanly and Completely?
    ... > My computer is running slow ever since i installed the MySQL server ... > automatically when I boot the box. ... You can start or stop the daemon from the commandline also ...
    (SuSE)
  • Re: ps information leak in FreeBSD
    ... > mysql -u user -p mypassword ... > on the commandline, thinking that this info will not show up in ps listings when ps ...
    (Bugtraq)
  • Cant connect to MySQL server on localhost (10061)
    ... Apache and PHP are funtioning properly (I can open a page like ... But now i've come upon a problem with MySQL. ... I don't know whether it's a good way to test the MySQL server but on ... And I got mysql> commandline. ...
    (comp.lang.php)