|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Quick mysql dump from file using php
hey everyone,
looking for a quick way to read a file holding the mysql table dump and dumping it into mysql. I got it down to where it is reading the dump file, but what command do i use to execute it against the db? Thanks
__________________
Nothing is Everything
|
|
#2
|
|||
|
|||
|
Simplest way is to do through phpMyadmin but sometimes phpMyAdmin gives memory problems and sometimes it takes tooooooooo long time.. And it may happen that query wont be executed.
It happened to me so i wrote a script to do it myself. PHP Code:
Replace the backup.sql with your file name. I used this to execute a phpBB mySQL dump into the database. Hope that helps. |
|
#3
|
|||
|
|||
|
ya it does thanks so much, quick question though. What are u doing with the explode function there.
|
|
#4
|
|||
|
|||
|
Explode() function there is splitting the readed file with the ; and a line break
for example : INSERT INTO table (id,name) VALUES ('ok','notok'); INSERT INTO table2 *********; These are both are splitted and each gets executed. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Quick mysql dump from file using php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|