grr/server/grr_response_server/databases/mysql.py
def Connect():
      """Returns a MySQLdb connection and creates the db if it doesn't exist."""
      args = self._GetConnectionArgs(
          host=host, port=port, user=user, passwd=passwd, db=db)
      try:
        return MySQLdb.Connect(**args)
      except MySQLdb.Error as e:
        # Database does not exist
        if e[0] == _ER_BAD_DB_ERROR:
          CreateDatabase(**args)
          return MySQLdb.Connect(**args)
        else:
          raise
Returns a MySQLdb connection and creates the db if it doesn't exist.
Returns a MySQLdb connection and creates the db if it doesn't exist.
Returns a MySQLdb connection and creates the db if it doesn ' t exist .
def Connect():
      args = self._GetConnectionArgs(
          host=host, port=port, user=user, passwd=passwd, db=db)
      try:
        return MySQLdb.Connect(**args)
      except MySQLdb.Error as e:
        if e[0] == _ER_BAD_DB_ERROR:
          CreateDatabase(**args)
          return MySQLdb.Connect(**args)
        else:
          raise
def Connect ( ) : args = self . _GetConnectionArgs ( host = host , port = port , user = user , passwd = passwd , db = db ) try : return MySQLdb . Connect ( ** args ) except MySQLdb . Error as e : if e [ 0 ] == _ER_BAD_DB_ERROR : CreateDatabase ( ** args ) return MySQLdb . Connect ( ** args ) else : raise
Returns a MySQLdb connection and creates the db if it doesn't exist.
Returns a MySQLdb connection and creates the db if it doesn ' t exist .
"""Returns a MySQLdb connection and creates the db if it doesn't exist.""" # Database does not exist