Package: dolphie
DolphieEcholocate your MySQL health with real-time monitoring in the terminalInstallationRequires Python 3.8+Using PyPi$pipinstalldolphieUsing Poetry$curl-sSLhttps://install.python-poetry.org|python3-

$poetryinstallUsing HomebrewIf you are aHomebrewuser, you can installdolphievia$brewinstalldolphieUsing Docker$dockerpullghcr.io/charles-001/dolphie:latest
$dockerrun-dit--namedolphieghcr.io/charles-001/dolphie:latest
$dockerexec-itdolphiedolphie-hhost.docker.internal-uroot--ask-passUsagepositional arguments:
  uri                   Use a URI string for credentials - format: mysql://user:password@host:port (port is optional with default 3306)

options:
  --help                show this help message and exit
  -u , --user           Username for MySQL
  -p , --password       Password for MySQL
  -h , --host           Hostname/IP address for MySQL
  -P , --port           Port for MySQL (Socket has precendence)
  -S , --socket         Socket file for MySQL
  --config-file         Dolphie's config file to use. Options are read from these files in the given order: /etc/dolphie.cnf, ~/.dolphie.cnf
  --mycnf-file          MySQL config file path to use. This should use [client] section [default: ~/.my.cnf]
  -f , --host-cache-file
                        Resolve IPs to hostnames when your DNS is unable to. Each IP/hostname pair should be on its own line using format ip=hostname [default: ~/dolphie_host_cache]
  -q , --host-setup-file
                        Specify location of file that stores the available hosts to use in host setup modal [default: ~/dolphie_hosts]
  -l , --login-path     Specify login path to use with mysql_config_editor's file ~/.mylogin.cnf for encrypted login credentials. Supercedes config file [default: client]
  -r , --refresh_interval
                        How much time to wait in seconds between each refresh [default: 1]
  -H , --heartbeat-table
                        If your hosts use pt-heartbeat, specify table in format db.table to use the timestamp it has for replication lag instead of Seconds_Behind_Master from SHOW REPLICA STATUS
  --ssl-mode            Desired security state of the connection to the host. Supports: REQUIRED/VERIFY_CA/VERIFY_IDENTITY [default: OFF]
  --ssl-ca              Path to the file that contains a CA (certificate authority)
  --ssl-cert            Path to the file that contains a certificate
  --ssl-key             Path to the file that contains a private key for the certificate
  --panels              What panels to display on startup separated by a comma. Supports: dashboard,processlist,graphs,replication,metadata_locks,ddl [default: dashboard,processlist]
  --graph-marker        What marker to use for graphs (available options: https://tinyurl.com/dolphie-markers) [default: braille]
  --pypi-repository     What PyPi repository to use when checking for a new version. If not specified, it will use Dolphie's PyPi repository
  --hostgroup           This is used for creating tabs and connecting to them for hosts you specify in Dolphie's config file under a hostgroup section. As an example, you'll have a section called [cluster1] then below it you will list each host on a new line in the format key=host (keys have no meaning). Hosts support optional port (default is whatever port parameter is) in the format host:port. You can also name the tabs by suffixing ~tab_name to the host (i.e. 1=host~tab_name)
  --show-trxs-only      Start with only showing threads that have an active transaction
  --additional-columns  Start with additional columns in Processlist panel
  -V, --version         Display version and exit

MySQL my.cnf file supports these options under [client] section:
	host
	user
	password
	port
	socket
	ssl_mode REQUIRED/VERIFY_CA/VERIFY_IDENTITY
	ssl_ca
	ssl_cert
	ssl_key

Login path file supports these options:
	host
	user
	password
	port
	socket

Environment variables support these options:
	DOLPHIE_USER
	DOLPHIE_PASSWORD
	DOLPHIE_HOST
	DOLPHIE_PORT
	DOLPHIE_SOCKET

Dolphie's config supports these options under [dolphie] section:
	(str) user
	(str) password
	(str) host
	(int) port
	(str) socket
	(str) ssl_mode
	(str) ssl_ca
	(str) ssl_cert
	(str) ssl_key
	(str) mycnf_file
	(str) login_path
	(str) host_cache_file
	(str) host_setup_file
	(int) refresh_interval
	(str) heartbeat_table
	(str) startup_panels
	(str) graph_marker
	(str) pypi_repository
	(str) hostgroup
	(bool) show_trxs_only
	(bool) show_additional_query_columnsSupported MySQL versionsMySQL/Percona Server 5.6/5.7/8.0+RDS/AuroraGrants requiredLeast privilegePROCESS (only if you switch to using processlist viaPcommand)SELECT toperformance_schema+pt-heartbeat table(if used)REPLICATION CLIENT/REPLICATION SLAVEBACKUP_ADMIN (MySQL 8 only)RecommendedPROCESS (only if you switch to using processlist viaPcommand)Global SELECT access (good for explaining queries, listing all databases, etc)REPLICATION CLIENT/REPLICATION SLAVESUPER (required if you want to kill queries)BACKUP_ADMIN (MySQL 8 only)FeaturesTabs docked at the top to seamlessly switch between connected hostsHostgroups to make it easy for connecting to multiple hosts at onceDolphie uses panels to present groups of data. They can all be turned on/off to have a view of your database server that you preferGraphs for many metrics that can give you great insight into how your database is performingSparkline to show queries per second in a live view2 options for finding replica lag in this order of precedence:pt-heartbeat table(specified by--heartbeat-table)SHOW SLAVE STATUSKeeps a history of the servers you connect to that provides autocompletion for hostnames in the Host Setup modalHost cache file. This provides users a way to specify hostnames for IPs when their network's DNS can't resolve them. An example use case for this is when you connect to your work's VPN and DNS isn't available to resolve IPs. In my opinion, it's a lot easier to look at hostnames than IPs!Supports encrypted login credentials viamysql_config_editorAutomatic conversion of large numbers & bytes to human-readableNotifies when new version is availableMany commands at your fingertips with autocompletion for their inputHostgroupsHostgroups are a way to easily connect to multiple hosts at once. To set this up, you will create a section in Dolphie's config file with the name you want the hostgroup to be and list each host on a new line in the formatkey=host(keys have no meaning). Hosts support optional port (default is whateverportparameter is) in the formathost:port. You can also name the tabs by suffixing~tab_nameto the host. Once ready, you will use the parameterhostgrouporHost Setupmodal to see it in action!Note: Colors can be used in the tab name by using the format[color]text[/color](i.e.[red]production[/red]). You can also use emojis supported by Rich (can see them by runningpython -m rich.emoji) by using the format:emoji:(i.e.:ghost:). Rich supports the normal emoji shortcodes.Example:[cluster1]1=host12=host2:33073=host3:3308~[red]production[/red] :ghost:Things to noteOrder of precedence for methods that pass options to Dolphie:Command-lineEnvironment variablesDolphie's config (set by--config-file)~/.mylogin.cnf (mysql_config_editor)~/.my.cnf (set by--mycnf-file)FeedbackI welcome all questions, bug reports, and requests. If you enjoy Dolphie, please let me know! I'd love to hear from you :smiley: