SILENT KILLERPanel

Current Path: > > opt > hc_python > lib64 > python3.12 > > site-packages > mysql > connector > > django


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/hc_python/lib64/python3.12//site-packages/mysql/connector//django

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 0 bytes April 04 2025 08:02:21.
base.py File 20622 bytes April 04 2025 08:02:21.
client.py File 1882 bytes April 04 2025 08:02:21.
compiler.py File 2002 bytes April 04 2025 08:02:21.
creation.py File 5769 bytes April 04 2025 08:02:21.
features.py File 4331 bytes April 04 2025 08:02:21.
introspection.py File 13415 bytes April 04 2025 08:02:21.
operations.py File 11793 bytes April 04 2025 08:02:21.
schema.py File 3634 bytes April 04 2025 08:02:21.
validation.py File 2605 bytes April 04 2025 08:02:21.

Reading File: //opt/hc_python/lib64/python3.12//site-packages/mysql/connector//django/client.py

# MySQL Connector/Python - MySQL driver written in Python.

import django
import subprocess

if django.VERSION >= (1, 8):
    from django.db.backends.base.client import BaseDatabaseClient
else:
    from django.db.backends import BaseDatabaseClient


class DatabaseClient(BaseDatabaseClient):
    executable_name = 'mysql'

    @classmethod
    def settings_to_cmd_args(cls, settings_dict):
        args = [cls.executable_name]

        db = settings_dict['OPTIONS'].get('database', settings_dict['NAME'])
        user = settings_dict['OPTIONS'].get('user',
                                            settings_dict['USER'])
        passwd = settings_dict['OPTIONS'].get('password',
                                              settings_dict['PASSWORD'])
        host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])
        port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])
        defaults_file = settings_dict['OPTIONS'].get('read_default_file')

        # --defaults-file should always be the first option
        if defaults_file:
            args.append("--defaults-file={0}".format(defaults_file))

        # We force SQL_MODE to TRADITIONAL
        args.append("--init-command=SET @@session.SQL_MODE=TRADITIONAL")

        if user:
            args.append("--user={0}".format(user))
        if passwd:
            args.append("--password={0}".format(passwd))

        if host:
            if '/' in host:
                args.append("--socket={0}".format(host))
            else:
                args.append("--host={0}".format(host))

        if port:
            args.append("--port={0}".format(port))

        if db:
            args.append("--database={0}".format(db))

        return args

    def runshell(self):
        args = DatabaseClient.settings_to_cmd_args(
            self.connection.settings_dict)
        subprocess.call(args)

SILENT KILLER Tool