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

mysql-to-json

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-to-json

Connects to a MySQL database and exports selected data to JSON.

  • 1.0.0
  • PyPI
  • Socket score

Maintainers
1

Connects to a MySQL database and exports selected data to JSON.

Usage

mysql-to-json [-h] [-d DATABASE] [-H HOSTNAME] [-P PORT] [-u USER] [-p]
                     [-e QUERY]

optional arguments:
  -h, --help            show this help message and exit
  -d DATABASE, --database DATABASE
                        MySQL database name.
  -H HOSTNAME, --hostname HOSTNAME
                        MySQL host name.
  -P PORT, --port PORT  MySQL port number.
  -u USER, --user USER  MySQL username.
  -p, --password        Shh! It's a secret.
  -e QUERY, --query QUERY
                        Query to run.

Examples

All examples simple select all table information from information_schema and save it to tables.json

Simple

This assumes we have full access to the mysql database from localhost.

$> mysql-to-json -e 'SELECT * FROM information_schema.tables' > tables.json

Medium Complexity

This explicitly sets a user and asks for a password, while still connecting to localhost.

$> mysql-to-json -d mysql -u seth -p -e 'SELECT * FROM information_schema.tables' > tables.json

All The Things!

This explicitly sets every command line option available.

$> mysql-to-json -h mydbserver.myhost.com -P 3306 -d mysql -u seth -p -e 'SELECT * FROM information_schema.tables' > tables.json

Keywords

FAQs


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