@carisls/mysql-pull
v1.3.1
Published
A CLI tool to pull all accounts from MySQL server and create separate files with user and their privileges.
Downloads
34
Readme
MySQL Access Pull
A CLI tool to pull all accounts from MySQL server and create separate files with user and their privileges.
Tool allows a header wrapped in a multiline comment at the top
/*
Application: Application 1
Server: my-server.example.com
Owner: [email protected]
*/Install
npm i -g @carisls/mysql-pullUsage
Example: Provide a connection string, a destination folder and an ignore pattern
dbPull -c 'mysql://username:[email protected]:3306/database' -f ./service-accounts -i '_123$'Needed privileges
In order to excute this CLI and be able to pull all user privileges, user needs to have those grants:
-- Replace 'your_user'@'your_host' with your user
GRANT SELECT ON mysql.* TO 'your_user'@'your_host';
GRANT SHOW DATABASES ON *.* TO 'your_user'@'your_host';Help
Usage: dbPull [options]
Options:
-V, --version output the version number
-c, --connectionString <string> Database connection string (alt DATABASE_CONN env var)
-f, --folder <string> Destination folder
-i, --ignore <string> Ignore account RegExp pattern
-h, --help display help for command