Jump to content

mysqldump SOLVED with thanks in the final post


niche

Recommended Posts

I'd like to get away from manual bu with phpmyadmin.

 

mysqldump looks like the answer, but my output is empty and there's no errors. My db doesn't have a pw.

 

Here's my code:

shell_exec("mysqldump armor '' emily alpha,catkey > e:/sql/alpha2.sql");

What do you think the problem is?

Edited by niche
Link to comment
Share on other sites

even though your user has no password you have to specify the user.

mysqldump -u root database_name > e:/sql/alpha2.sql

try running the command on command line first to see if you get the desired result and then put int on php script

and if you are on windows, you might have to include the full path to mysqldump (something like "c:program filesmysqlbinmysqldump.exe -u root database_name > e:/sql/alpha2.sql")

Edited by Lulzim
  • Like 1
Link to comment
Share on other sites

This works from the command line:

e:wampbinmysqlmysql5.1.33binmysqldump -h localhost -u armor -p  emily alpha> e:sqlalpha4.sql
How do I run this from php without being promped for a pw? I thought I could use shell_exec(), but no joy.
Link to comment
Share on other sites

Solved.

shell_exec("wampbinmysqlmysql5.1.33binmysqldump -h localhost -u armor emily alpha> e:sqlalpha5.sql");

Was missing the path for mysqldump. Never used shell_exec() before. I didn't expect the path to be relevant. lulzim's tip led to the solution.

 

Thanks for your help lulzim.

Edited by niche
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...