Registry / devops / agent-mysql

agent-mysql

JSON →
library1.0.0jsnpmunverified

MySQL CLI tool designed for AI Agents, version 1.0.0. All commands output JSON for programmatic consumption. Each command opens a separate connection and closes immediately. Supports three connection methods: command-line flags, DSN string, and saved profiles via config file. Provides safety features requiring --force for destructive operations. Ideal for AI agents needing simple, repeatable MySQL access with predictable output.

npm install agent-mysql
INSTALL
IMPORT
SIG · AGENT-MYSQL
A
agent-mysql
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Show how to run a query with full connection parameters each time.

agent-mysql -h localhost -P 3306 -u root -p mypassword -d mydb query "SELECT * FROM users LIMIT 5"
Debug
Known issues
gotchaPassword provided via -p flag is visible in process list. Use --dsn or config profiles to avoid exposure.
fix
Use `--dsn` with a DSN string or config set to store password in config file.
affects: >=1.0.0
gotchaConfig file is stored in plain JSON in .agent-mysql/config.json. Avoid committing passwords to version control.
fix
Add .agent-mysql/config.json to .gitignore or use environment variables instead of config.
affects: >=1.0.0
gotchaDefault --limit 200 on SELECT queries may truncate results unknowingly.
fix
Specify --limit 0 or a higher number to get all rows.
affects: >=1.0.0
Errors
Common errors & fixes
agent-mysql: command not found
Package not installed globally.
fix
Run `npm install -g agent-mysql`
Error: Connection failed: Access denied for user 'root'@'localhost'
Incorrect password or user permissions.
fix
Verify password and ensure user has access from the connecting host.
Error: DROP/TRUNCATE/ALTER require --force flag
Safety mechanism prevents destructive DDL without confirmation.
fix
Add `--force` flag: `agent-mysql -h ... query "DROP TABLE users" --force`
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
agent-mysql — npm install agent-mysql · libregistry