Want a simple SQL database client? Try Emacs. Emacs has an alright sql-mode. Here’s how to use it to connect to a MySQL server.
- Type the meta command:
M-x
- To connect the server, type:
sql-mysql
- Enter username, password, host, and database name when prompted.
- Open a new buffer:
C-x [new buffer name]
- Type the meta command:
M-x
- To put the buffer in sql-mode, type:
sql-mode
- To send a query to the DB, type:
C-x C-b
Tip: If your columns wrap, unwrap them with
M-x toggle-truncate-lines
Also to set all buffers in sql-mode to use a connection, type:
M-x sql-set-sqli-buffer-generally
That’s it. Send queries and retrieve results in Emacs. On less reason to leave Emacs. Many databases are supported. My install lists the following DBs: DB2, Informix, Oracle, Sybase, Ingres, MySQL, and PostgreSQL.