Re: [PHP] pumping database dump in mysql
On Saturday 21 April 2001 15:39, Peter Van Dijck wrote: Hi, I want to write a script that takes a mysql dump file and pumps it into the database. What about simply using phpMyAdmin? -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] pumping database dump in mysql
If you can do it on the command line why not just use the system function and use the command you would use on the command line..? What you try to do now is to feed the whole dump file to mysql_query.. This will never work because mysql_query will only accept one query at a time and the mysqldump utility which you probably used also adds some comments in the dump file which can't be handled by mysql_query.. If you DO want to do it through PHP try to break the dump file into some array so that all the queries in the dump file are seperated and then make sure that you strip all not SQL data.. It's probably not worth the work... Problem gets easier when you create the dump yourself with PHP... My suggestion is to not work with dump files but to get an second mysql database on another machine and backup your database to that machine.. Makes everything easier, when you have a problem the other database can directly be used to restore the backup and you don't have to search for the dump file.. Sucess.. Bye Bye David I want to write a script that takes a mysql dump file and pumps it into the database. I got the dump in a variable and then did $res = mysql_query($dumpvariable); but that doesn't work? I know how to do it on the command line, I just want to do it in a php script... thanks for any hints! Peter ~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, updown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] pumping database dump in mysql
Isn't that what load data infile does? http://www.mysql.com/doc/L/O/LOAD_DATA.html Data Driven Design P.O. Box 1084 Holly Hill, Florida 32125-1084 http://www.datadrivendesign.com http://www.rossidesigns.net - Original Message - From: Peter Van Dijck [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 21, 2001 9:39 AM Subject: [PHP] pumping database dump in mysql Hi, I want to write a script that takes a mysql dump file and pumps it into the database. I got the dump in a variable and then did $res = mysql_query($dumpvariable); but that doesn't work? I know how to do it on the command line, I just want to do it in a php script... thanks for any hints! Peter ~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, updown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]