jeff5656 Posted August 3, 2011 Share Posted August 3, 2011 Here's how I back up all databases and all tables. $creatBackup = "mysqldump -u ".$user." --password=".$password." --all-databases > ".$sqlFile; How would I run that and exclude certain tables in certain databases? lets say I want to exclude a table called test in database "testdb" and a table called "hello" from database "hellodb"? Quote Link to comment https://forums.phpfreaks.com/topic/243744-backing-up-the-databases/ Share on other sites More sharing options...
requinix Posted August 3, 2011 Share Posted August 3, 2011 Try the --ignore-table option. Quote Link to comment https://forums.phpfreaks.com/topic/243744-backing-up-the-databases/#findComment-1251485 Share on other sites More sharing options...
jeff5656 Posted August 3, 2011 Author Share Posted August 3, 2011 Would it be this? $creatBackup = "mysqldump -u ".$user." --password=".$password." --all-databases --ignore-table=database.table1 --ignore-table=database.table2 > ".$sqlFile; Just want to make sure i got the syntax down...not sure if I would keep the all database line in there... Quote Link to comment https://forums.phpfreaks.com/topic/243744-backing-up-the-databases/#findComment-1251491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.