A lightning-fast, cross-platform MySQL client written in Rust that provides a familiar interface for MySQL users while leveraging Rust's performance and safety features.
- 🚀 Cross-Platform Support: Works on Windows, macOS, and Linux
- 🎨 Syntax Highlighting: Beautiful, colorized output for better readability
- 📝 Command History: Persistent command history with readline support
- 🔒 Secure: Safe password handling and connection management
- 💻 Familiar Interface: Similar to the official MySQL client
- ⚡ Performance: Built with Rust for optimal speed and memory usage
cargo install rusql
Or build from source:
git clone https://github.com/tristanpoland/rusql.git
cd rusql
cargo build --release
Connect to a local MySQL server:
rusql -u root -p
Connect to a remote server:
rusql -h hostname -P 3306 -u username -p -D database
Option | Description | Default |
---|---|---|
-h, --host |
Host to connect to | localhost |
-P, --port |
Port number | 3306 |
-u, --user |
Username | None |
-p, --password |
Password (will prompt if not provided) | None |
-D, --database |
Database to use | None |
-e, --execute |
Execute command and quit | None |
--no-colors |
Disable colors in output | false |
- Multi-line query support
- Command history (stored in ~/.mysql_history)
- Tab completion (coming soon)
- Syntax highlighting
- Pretty-printed tables
- Support for all MySQL query types
- Formatted output for SELECT queries
- Visual feedback for affected rows
- Query timing information
- Error reporting with color highlighting
status
: Show server statusclear
or\c
: Clear screenuse [database]
: Switch database- More coming soon!
- Rust (1.70.0 or later)
- MySQL/MariaDB server (for testing)
- OpenSSL development libraries
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
src/
├── main.rs # Entry point and CLI handling
├── client.rs # MySQL client implementation
├── formatter.rs # Output formatting
└── commands.rs # Special command handling
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow the Rust style guidelines
- Use meaningful variable names
- Add comments for complex logic
- Include tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- The MySQL team for their amazing database
- The Rust MySQL crate maintainers
- All contributors to this project
- Tab completion for tables and columns
- Support for importing/exporting SQL files
- Better error messages and suggestions
- Separate main file into components
- Configuration file support
- Plugin system for extensions
- SSH tunnel support
- Result set pagination