View Single Post
  #4 (permalink)  
Old 04-16-2009, 10:45 AM
wcervini wcervini is offline
Junior Member
 
Join Date: Apr 2009
Posts: 1
Default anohter one

Quote:
Originally Posted by swordfish View Post
Code:
DBS=`echo "show databases;" | mysql -u root -pmypassword | tail -n +2`
I think this is what you need, $DBS will contain a list you can loop through and do you stuff.

HTH
Or use this one

Code:
DBS=`mysql -u root -pmypassword -e 'show databases' | tail -n +2`
Reply With Quote