Posts Tagged ‘python mysql’

#!/usr/bin/env python
import ConfigParser
import os
import time

username = 'dbuser'
password = 'dbpassword'
hostname = 'localhost'

filestamp = time.strftime('%Y-%m-%d')

# Get a list of databases with :
database_list_command="mysql -u%s -p%s -h %s –silent -N -e 'show databases'" % (username, password, hostname)
for database in os.popen(database_list_command).readlines():
database = database.strip()

if database == 'information_schema':
[...]

Friday, April 1st, 2011 at 15:21 | 0 comments
Categories: Uncategorized
TOP