Minor, fallback to mysql if not exists

This commit is contained in:
Achilles Rasquinha 2018-01-24 22:29:07 +05:30
parent 8d43417a29
commit 2d5276e7ee

View file

@ -288,11 +288,12 @@ def mysql(context):
site = get_site(context)
frappe.init(site=site)
mysql = find_executable('mycli')
args = [mysql, '-u', frappe.conf.db_name, '-p'+frappe.conf.db_password, frappe.conf.db_name, '-h', frappe.conf.db_host or "localhost"]
args = ['-u', frappe.conf.db_name, '-p'+frappe.conf.db_password, frappe.conf.db_name, '-h', frappe.conf.db_host or "localhost"]
if not mysql:
mysql = find_executable('mysql')
args.append("-A")
args.insert(0, mysql)
os.execv(mysql, args)
@click.command('console')