Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. function resetdb()
  2. {
  3. mysqlhost="asdf
  4. mysqluser="asdf"
  5. mysqlpasswd="asdf"
  6. mysqldb=( "asdf" "asdf")
  7.  
  8. for db in ${mysqldb[@]}; do
  9. mysqlshow -u$mysqluser -p$mysqlpasswd -h$mysqlhost $db | sed -e "/\+/d" -e "s/[\ |\|]//g" -e "/^Tables*/d" -e "/^Database:*/d" | awk '{ print "DROP TABLE " $0 ";" ; }' | mysql -v -u$mysqluser -p$mysqldb -h$mysqlhost $db
  10. mysql -u$mysqluser -p$mysqlpasswd -h$mysqlhost $mysqldb < ../../../database/$db.sql
  11. mysql -u$mysqluser -p$mysqlpasswd -h$mysqlhost $mysqldb < ../../../database/demo.sql
  12. done
  13. }
  14.  
  15. ./update.sh: line 34: syntax error near unexpected token `|'
  16. ./update.sh: line 34: ` mysqlshow -u$mysqluser -p$mysqlpasswd -h$mysqlhost $db | sed -e "/\+/d" -e "s/[\ |\|]//g" -e "/^Tables*/d" -e "/^Database:*/d" | awk '{ print "DROP TABLE " $0 ";" ; }' | mysql -v -u$mysqluser -p$mysqldb -h$mysqlhost $db'
  17. ./update.sh: line 35: ../../../database/.sql: No such file or directory
  18. mysql: option '-h' requires an argument
  19. ./update.sh: line 37: syntax error near unexpected token `done'
  20. ./update.sh: line 37: ` done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement