PEATDB/Utils.py
def createDBonServer(prj, settings={}, callback=None, access=None):
    """Create a project on the mysql server"""
    import MySQLdb as mysql
    db = mysql.connect(**settings)
    c = db.cursor()
    cmd = "create database " + prj + ";"
    try:
        c.execute(cmd)
    except:
        pass
    if access != None:
        cmd = "grant all privileges on " + prj + ".* to " + "'"+access+"'"+ "@'%';"
        c.execute(cmd)
    return True
Create a project on the mysql server
Create a project on the mysql server
Create a project on the mysql server
def createDBonServer(prj, settings={}, callback=None, access=None):
    import MySQLdb as mysql
    db = mysql.connect(**settings)
    c = db.cursor()
    cmd = "create database " + prj + ";"
    try:
        c.execute(cmd)
    except:
        pass
    if access != None:
        cmd = "grant all privileges on " + prj + ".* to " + "'"+access+"'"+ "@'%';"
        c.execute(cmd)
    return True
def createDBonServer ( prj , settings = { } , callback = None , access = None ) : import MySQLdb as mysql db = mysql . connect ( ** settings ) c = db . cursor ( ) cmd = "create database " + prj + ";" try : c . execute ( cmd ) except : pass if access != None : cmd = "grant all privileges on " + prj + ".* to " + "'" + access + "'" + "@'%';" c . execute ( cmd ) return True
Create a project on the mysql server
Create a project on the mysql server
"""Create a project on the mysql server"""
prj
settings
callback
access