cli.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:proxysql-tools 作者: twindb 项目源码 文件源码
def create(cfg, username, password, active, use_ssl,  # pylint: disable=too-many-arguments
           default_hostgroup, default_schema, schema_locked,
           transaction_persistent, fast_forward,
           backend, frontend, max_connections):
    """Add user of MySQL backend to ProxySQL"""
    kwargs = {
        'username': username,
        'password': password,
        'use_ssl': use_ssl,
        'active': active,
        'default_hostgroup': default_hostgroup,
        'default_schema': default_schema,
        'schema_locked': schema_locked,
        'transaction_persistent': transaction_persistent,
        'backend': backend,
        'frontend': frontend,
        'fast_forward': fast_forward,
        'max_connections': max_connections
    }
    try:
        create_user(cfg, kwargs)
        LOG.info('User %s successfully created', username)
    except MySQLError as err:
        LOG.error('Failed to talk to database: %s', err)
    except (NoOptionError, NoSectionError) as err:
        LOG.error('Failed to parse config: %s', err)
        exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号