NodeJS MySQL/MariaDB Terminal
NodeJS MySQL/MariaDB Terminal is a remote terminal for MySQL/MariaDB databases, which works in the same way as the official shell does!
Features
-
Secure connection to the database through the mysql npm package, with SSL support.
-
Debugging mode to analyze and check for problems with the database
-
Clean looking console, possibility to activate/deactivate color mode
-
Completely free to redistribute (with appropriate credits and license, along a copy of this README)
How to install
git
Using To install the terminal using git:
- Clone this repository, by running the
git clone https://github.com/TeknoSenpai/MySQL-MariaDB-Node-Terminal.git
in your console.
Beware that you'll need to install and configure git, a guide that explains how to do so can be found here
How to use
Terminal Mode
To run the terminal, you can use the terminal
script, with the npm run terminal
command.
Single-Query Mode
The terminal also supports a "single-query" usage, through CLI Arguments.
Simply run the index.js
file with the node index.js -q (query)
Example: node index.js -q SHOW VARIABLES LIKE 'port';
You might need to wrap the query in apexes (") depending on your console's settings, to avoid ER_PARSE_ERROR
errors
SQL File Mode (In development)
You can use SQL Script Files .sql
to run a series of queries at a single time!. Run the npm run sql <path to file (can be relative)>
Debug Mode
To start the terminal in debug mode, use the debug
script, or run the index file with the node index.js -debug true
command. The console will throw a warning, to suppress it, go in the config.json
file and set silent_debug
to true
.
In debug mode, the console will log the raw data recived from the database, along with any error.
Please keep in mind that some personal data might be exposed, such as user, password, server address and other. Use debug mode at your own risk.
Configuring the terminal
The terminal doesn't need an extensive configuration. To create a config file, run the npm run create-config
command.
- Example
config.json
file:
{
"data":{
"silent_debug":false,
"no_color":false
},
"database_connection":{
"host":"localhost",
"user":"tekno",
"password":"tekno",
"database":"mysql"
}
}
The config file is straightforward, here is a list of the meaning of all the options:
data
:
silent_debug
: Suppresses the debug Mode Warning when debug mode is activated. Default:false
no_color
: Disables the usage of colors in the terminal, this is to support monochrome terminals or if you just don't like colors. Default:false
database_connection
:
- A detailed description of this can be found here
Credits and How to contribute
- Credits:
- Author: TeknoSenpai
(Special thanks to the Hiri Devs Org)
- Author: TeknoSenpai
- How to contribute:
- Fork the repository
- Clone your fork locally (
git clone (repo url)
) - Add your work (
git add .
) - Create a new branch (
git checkout -b "your branch name (can be your username)"
) - Commit (
git commit -m "Your very detailed description"
) - Start a pull request and wait
Screenshots
Some screenshots of the terminal in action, taken from the Manjaro Shell.