{"id":15442907,"url":"https://github.com/sethblack/mysql-to-json","last_synced_at":"2025-04-19T20:13:36.348Z","repository":{"id":57444566,"uuid":"121446482","full_name":"sethblack/mysql-to-json","owner":"sethblack","description":"Connects to a MySQL database and exports selected data to JSON.","archived":false,"fork":false,"pushed_at":"2020-02-24T19:58:53.000Z","size":7,"stargazers_count":22,"open_issues_count":3,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-18T13:16:44.254Z","etag":null,"topics":["command-line","command-line-tool","json","mysql","mysql-json","python","python-3","python-script","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sethblack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-13T22:56:07.000Z","updated_at":"2023-12-19T08:43:49.000Z","dependencies_parsed_at":"2022-09-26T16:51:03.706Z","dependency_job_id":null,"html_url":"https://github.com/sethblack/mysql-to-json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethblack%2Fmysql-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethblack%2Fmysql-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethblack%2Fmysql-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethblack%2Fmysql-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sethblack","download_url":"https://codeload.github.com/sethblack/mysql-to-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249788948,"owners_count":21325776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-tool","json","mysql","mysql-json","python","python-3","python-script","python3"],"created_at":"2024-10-01T19:31:28.395Z","updated_at":"2025-04-19T20:13:36.317Z","avatar_url":"https://github.com/sethblack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql-to-json\n\nConnects to a MySQL database and exports selected data to JSON.\n\n## Installation\n\n```\n$\u003e pip3 install mysql-to-json\n```\n\n## Usage\n```\nmysql-to-json [-h] [-d DATABASE] [-H HOSTNAME] [-P PORT] [-u USER] [-p]\n                     [-e QUERY]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d DATABASE, --database DATABASE\n                        MySQL database name.\n  -H HOSTNAME, --hostname HOSTNAME\n                        MySQL host name.\n  -P PORT, --port PORT  MySQL port number.\n  -u USER, --user USER  MySQL username.\n  -p, --password        Shh! It's a secret.\n  -e QUERY, --query QUERY\n                        Query to run.\n```\n\n## Examples\n\nAll examples simple select all table information from `information_schema` and save it to `tables.json`\n\n### Simple\n\nThis assumes we have full access to the mysql database from localhost.\n\n```\n$\u003e mysql-to-json -e 'SELECT * FROM information_schema.tables' \u003e tables.json\n```\n\n### Medium Complexity\n\nThis explicitly sets a user and asks for a password, while still connecting to localhost.\n\n```\n$\u003e mysql-to-json -d mysql -u seth -p -e 'SELECT * FROM information_schema.tables' \u003e tables.json\n```\n\n### All The Things!\n\nThis explicitly sets every command line option available.\n\n```\n$\u003e mysql-to-json -h mydbserver.myhost.com -P 3306 -d mysql -u seth -p -e 'SELECT * FROM information_schema.tables' \u003e tables.json\n```\n\n### All The Things without prompt access\n\nThis explicitly sets every command line option available and uses password stored in variable `$MYSQL_PASSWORD`.\n\n```\n$\u003e echo $MYSQL_PASSWORD | mysql-to-json -h mydbserver.myhost.com -P 3306 -d mysql -u seth -p -e 'SELECT * FROM information_schema.tables' \u003e tables.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethblack%2Fmysql-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsethblack%2Fmysql-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethblack%2Fmysql-to-json/lists"}