Skip to content

Instantly share code, notes, and snippets.

@latavin243
Last active June 6, 2024 07:19
Show Gist options
  • Save latavin243/5524a5c53252db3ba0a8fe1ffd83f35d to your computer and use it in GitHub Desktop.
Save latavin243/5524a5c53252db3ba0a8fe1ffd83f35d to your computer and use it in GitHub Desktop.
org-mode DB connection table to mycli commands / JDBC url
DescHostPortUserPwdDB
testtest_host3306test_usertest_pwdtest_db
prodprod_host3306marketplace_uatprod_pwdtest_db
for row in tab:
    desc, host, port, user, pwd, db = tuple(row)
    print(f'[{desc}]')
    print(f'mycli -h {host} -P {port} -u {user} -p {pwd} -D {db} # mysql')
    print(f'jdbc:mysql://{host}:{port}/{db}?autoReconnect=true&timeout=60s&collation=utf8mb4_unicode_ci&readTimeout=60s&writeTimeout=60s&timeout=60s')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment