Example #1
1
 def get_connection(self, path, log=None, user=None, password=None, host=None, port=None, params={}):
     cnx = MySQLConnection(path, log, user, password, host, port, params)
     if not self.required:
         self._mysql_version = 'server: "%s", client: "%s", thread-safe: %s' % (
             cnx.cnx.get_server_info(),
             MySQLdb.get_client_info(),
             MySQLdb.thread_safe(),
         )
         self.required = True
     return cnx
Example #2
1
 def get_connection(self, path, log=None, user=None, password=None, host=None, port=None, params={}):
     cnx = MySQLConnection(path, log, user, password, host, port, params)
     if not self._version:
         self._version = get_pkginfo(MySQLdb).get("version", MySQLdb.__version__)
         mysql_info = 'server: "%s", client: "%s", thread-safe: %s' % (
             cnx.cnx.get_server_info(),
             MySQLdb.get_client_info(),
             MySQLdb.thread_safe(),
         )
         self.env.systeminfo.extend([("MySQL", mysql_info), ("MySQLdb", self._version)])
     return cnx
Example #3
1
    def tryTesting(self):

        conn = MySQLdb.connect(host=self.HOSTNAME, user=self.USERNAME, passwd=self.PASSWORD, db=self.SCHEMA)

        self.logger.info("Client: %s", MySQLdb.get_client_info())
        self.logger.info("Server: %s %s", conn.get_host_info(), conn.get_server_info())

        # TODO
        # self.logger.debug(str(result))
        # if result: return True
        # else: return False

        conn.close()
Example #4
1
 def open(self, verbose=0):
     try:
         if int(MySQLdb.get_client_info().split(".")[0]) >= 5:
             self.db = MySQLdb.connect(
                 user=self.user, host=self.host, passwd=self.passwd, db=self.dbname, port=self.port, local_infile=1
             )
         else:
             self.db = MySQLdb.connect(
                 user=self.user, host=self.host, passwd=self.passwd, db=self.dbname, port=self.port
             )
     except MySQLdb.Error, e:
         if verbose > 0:
             print "*** Error %d: %s" % (e.args[0], e.args[1])
             sys.stdout.flush()
         return False
 def get_mysql_version(self):
     MySQLdb.get_client_info()
Example #6
1
 def get_internal_version(self):
     return MySQLdb.get_client_info()
Example #7
0
 def get_mysql_version(self):
     """return the mysql version"""
     return MySQLdb.get_client_info()