Tried capture DB login failed when running exec (mysqldump..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
genux33
Forum Newbie
Posts: 18
Joined: Sun Apr 10, 2005 8:22 am

Tried capture DB login failed when running exec (mysqldump..

Post by genux33 »

Dear All,

How does you capture the error - mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: YES) from exec function when trying to connect
when trying to perform a failed mysqldump with invalid password (mysqldump -hlocalhost -uroot -pwrongpassword db_name tablename > /home/XXX.sqll)


i try excute the following, and receiving no output from the function and only log into php error log.

echo exec(mysqldump -hlocalhost -uroot -pwrongpassword db_name tablename > /home/XXX.sqll);

how should i obtained the error message from the function directly after excute the function.
Post Reply