Closed Thread Icon

Preserved Topic: mysqldump with php (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=21085" title="Pages that link to Preserved Topic: mysqldump with php (Page 1 of 1)" rel="nofollow" >Preserved Topic: mysqldump with php <span class="small">(Page 1 of 1)</span>\

 
Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 19:57

What do you think, is that possible?

After googling, I've found something like this:

code:
<?

$dump = "c:\mysql\bin\mysqldump --opt database > backupfile.sql";
shell_exec("cmd /c $dump");

?>



That probably works on Windows, but what would be a Linux equivalent?

"cmd /c" and Linux? OK? I don't think so.


[This message has been edited by Sash (edited 04-15-2002).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 04-15-2002 21:56

Ja ne vidim razlog za pozivanje mysqldump-a preko PHP-a, s obzirom da je to najobicniji command-line program. Jednostavno ga pokreni direktno iz Command Prompt-a (Windows) ili Telnet/SSH shell-a (Unix). Ako kojim slucajem nemas shell pristup do Unix server-a, onda mozes da ga pozoves na slican nacin kao sto si gore napisao, jedino sto treba da uradis je da zamenis putanju (c:\mysql\bin) sa odgovarajucom putanjom na Linux server-u, i prosledis takav string exec() funkciji, "cmd /c" deo nije uopste potrebno prevodini za Linux, jer je "mysqldump" fajl vec namesten da se izvrsava (CHMOD 755).

BTW Preporucio bih ti da instaliras phpMyAdmin, koji ce ti mnogo olaksati administraciju MySQL-a (preko web interfejsa), a ima i mogucnost pravljena SQL dump-ova, kao i jos mnogo toga.


Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 22:06

Cao Max,

Hvala ti na odgovoru.

Zasto hocu na ovaj nacin?

Zato sto je sajt radio neko drugi, i sada sam ga ja preuzeo. Ljudi koji su ga prije radili su zaista samo uzeli lovu, a posao nisu odradili kako treba. Kod njih je jos uvijek sajt, ali ja zelim da ga prebacim na novi server.
Sada odugovlace sa slanjem DB. Imam pristup FTP rootu, ali ne mogu da pokupim DB. Nisam probao ali ne bih rekao da imam telnet access. Tako da sam dosao na ovu ideju. Mada jos uvijek bezuspjesno.

Mozda mala duga i tebi beznacajna prica ali eto znas otprilike zasto pokusavam ovako :-)

Pozdrav


Oooops sorry if we are too cryptic here.

Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 22:07

P.S.

I know about phpmyadmin, amazing thing. But I didn't know that it has dump option as well. Now I'll try.

Thanks.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 04-15-2002 22:07

Well now how fair is that? I can't read that mr.maX !
OK now Sash has already responded and I can't read that either

Is there something wrong with my computer. It speaks a forgein language that I've not seen.

Later,
C:\


~Binary is best~


[This message has been edited by CPrompt (edited 04-15-2002).]

Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 22:11

Basically Max suggested to use Telnet, Command Prompt but I cannot use that.

Sorry cprompt

Sasha »

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 04-15-2002 22:14

CPrompt, if you learn Serbian you'll be able to understand what I wrote above...

Sasha, ako imas username i sifru za pristup MySQL bazi koju hoces da skines, jednostavno instaliraj phpMyAdmin i sa njim ces moci da odradis ceo posao...


Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 22:17

I am just doing that. Their connection is terrible.
I had to read from the file that is not in the FTP root in order to get the ID and Password. So everything is a learning process for me here :-)

Thx.

Sasha »

Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 22:33

Uploaded phpmyadmin files, modified config.inc.php file, and now I am getting this error:

Fatal error: Failed opening required './libraries/grab_globals.lib.php'



PHP Version 4.0.6

Sasha »

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 04-15-2002 22:47

Proveri da li su fajlovi u libraries folder-u uploadovani kako treba. Ako nije problem u tome, iz nekog razloga PHP na toj masini ne shvata putanju do fajla, probaj da ./libraries/ zamenis sa punom putanjom od root-a diska...


Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-15-2002 23:01

Ok, done. phpMyadmin works!

How do I do the dump?

That may be the last one

Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 04-16-2002 01:09

Got it!

Thanks Max for your help.

Sasha »

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 04-16-2002 07:05

Drago mi je da sam bio od pomoci...


DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 04-16-2002 10:15

Yah, I also just installed phpMyAdmin, and am I loving it! What a great tool, I wouldn't know what to do without it. (I'm still learning MySQL, so I also don't know what I'll do *with* it either, but all the bells and whistles I expected were there. I've got an Oracle book at the office, it's got the basics, and http://www.mysql.com/ has all the other syntax and help files, I'll get by.)

Your pal, -doc-

« BackwardsOnwards »

Show Forum Drop Down Menu