Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysqlconn

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysqlconn

  • 0.0.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

mysqlconn - The mysql connection assistant

Store mysql connection credentials in a simple, secure configuration file. Many destinations can then be used with the db_key you specify. You can also run script files against the names you select. The mysql prompt is set for safety.

Instructions

Install:

gem install mysqlconn

Create ~/.db_connection_alias.yml

config:
  default_arg:          # any desired default arguments
#    mysql: -A
    mysqldump: --quick --single-transaction
db_key:
  host: hostname
  port: port			# Optional
  user: username		# Optional
  password: password		# Optional
#  password: ''		# Optional, prompt for password
  database: database		# Optional
db_key2:
  ...

Protect configuration file:

chmod 600 ~/.db_connection_alias.yml

Usage

Connect:

mysqlconn db_key [additional options]

Look at that beautiful prompt:

mysqluser@db_key [database]> select now();
+---------------------+
| now()               |
+---------------------+
| 2014-04-15 11:09:33 |
+---------------------+
1 row in set (0.02 sec)

mysqluser@db_key [database]>

Pipe:

mysqlconn db_key < script.sql > output

etc..

To mysqldump:

mysqldumpconn db_key [additional options]

Verbose:

Add -v BEFORE the db_key to print out the final executed command to STDERR. BEWARE: It will print plain password.

Autocomplete

Add to bash.completion.d or wherever:

_mysqlconn() {
  local cur=${COMP_WORDS[COMP_CWORD]}
  COMPREPLY=( $( compgen -W "$(mysqlconn -l)" -- $cur ) )
}
complete -F _mysqlconn mysqlconn
complete -F _mysqlconn mysqldumpconn

License

Apache 2.0 - go nuts

FAQs

Package last updated on 23 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc