def change_root_password_if_necessary():
    try:
        db = MySQLdb.connect(user="root",passwd="root",host="localhost")
        print "'root' is an insecure root password for MySQL: starting a process to change it. You can just re-enter 'root' if you want."
    except:
        try:
            db = MySQLdb.connect(user="root",passwd="",host="localhost")
            print "Your root MySQL password is blank; starting a process to change it. You can just hit return at the prompts to keep it blank if you want."
        except:
            print "Root mysql password is neither blank nor 'root', so it's up to you to change it."
            return

    root = Configfile("root",default="/root/.my.cnf")
    root.change_client_password()
    root.write_out()
    print """
    root .my.cnf file updated with password at %s; delete that file if you don't want the root password anywhere on your server.
    """ % root.location
Query the database.
dataset/ETHPy150Open Bookworm-project/BookwormDB/bookwormDB/configuration.py/change_root_password_if_necessary--crossover with--dataset/ETHPy150Open namlook/mongokit/mongokit/document.py/Document.find