SHARE
TWEET

Untitled

a guest Aug 13th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MYSQL_DATA=mydb
  2. MYSQL_USER=root
  3. MYSQL_PASS=rootpassword
  4. MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}"
  5. SQL="SET group_concat_max_len = 102400;"
  6. SQL="${SQL} SELECT GROUP_CONCAT(CONCAT('--ignore-table=',table_name) SEPARATOR ' ')"
  7. SQL="${SQL} FROM information_schema.tables WHERE table_schema='${MYSQL_DATA}'"
  8. SQL="${SQL} AND table_name LIKE 'foo_%'"
  9. EXCLUSION_LIST=`mysql ${MYSQL_CONN} -AN -e"${SQL}"`
  10. mysqldump ${MYSQL_CONN} ${MYSQL_DATA} ${EXCLUSION_LIST} > ${MYSQL_DATA}_tables.sql
  11.      
  12. SQL="${SQL} AND table_name LIKE 'foo_%'"
  13.      
  14. SQL="${SQL} AND table_name REGEXP '_BAK_2[0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top