| name | mysql-service-manager |
| description | Manages MySQL services via Homebrew with RTK integration for token optimization. Provides easy start/stop/restart/status commands and monitoring capabilities. |
| category | devops |
MySQL Service Manager Skill
Manages MySQL services via Homebrew with RTK integration for token optimization. Provides easy start/stop/restart/status commands and monitoring capabilities.
When to Use
Use this skill when you need to:
- Start, stop, or restart MySQL@8.4 service via Homebrew
- Check service status and logs
- Set up monitoring for MySQL service
- Create easy-to-remember aliases for common MySQL operations
Prerequisites
- Homebrew installed (
which brew returns a path)
- MySQL@8.4 formula installed (
brew list | grep mysql@8.4)
- RTK (Rust Token Killer) installed for token optimization
Commands
Start MySQL Service
rtk brew services start mysql@8.4
Stop MySQL Service
rtk brew services stop mysql@8.4
Restart MySQL Service
rtk brew services restart mysql@8.4
Check Service Status
rtk brew services list | grep mysql@8.4
View MySQL Service Logs
rtk brew services info mysql@8.4
Easy Alias Commands (Add to shell profile)
Add these to your ~/.zshrc or ~/.bash_profile:
alias mysql-start='rtk brew services start mysql@8.4'
alias mysql-stop='rtk brew services stop mysql@8.4'
alias mysql-restart='rtk brew services restart mysql@8.4'
alias mysql-status='rtk brew services list | grep mysql@8.4'
alias mysql-info='rtk brew services info mysql@8.4'
Monitoring & Health Checks
Basic Connection Test
rtk mysqladmin -u root ping
Service Uptime Check
rtk mysqladmin -u root version
Process List
rtk mysqladmin -u root processlist
Troubleshooting
If Service Fails to Start
- Check logs:
rtk brew services info mysql@8.4
- Check configuration:
rtk cat $(brew --prefix)/etc/my.cnf
- Check for port conflicts:
rtk lsof -i :3306
- Repair database:
rtk mysqlcheck -u root --all-databases --auto-repair
Common Issues
- Port already in use: Another service is using port 3306
- Permission issues: Data directory permissions incorrect
- Corrupted tables: Run mysqlcheck or restore from backup
Verification Steps
After running any command, verify success by:
- Checking service status shows "started"
- Testing connection with
rtk mysqladmin ping
- Verifying no error messages in output
Examples
mysql-start
mysql-status
mysql-info
mysql-restart