Is there a way to set a color scheme for the mysql client? It might sound trivial, but I'd like to be able to set some level of colors for terminal client.
Is there a way to set a color scheme for the mysql client? It might sound trivial, but I'd like to be able to set some level of colors for terminal client.
You could use rlwrap if you just want a colour prompt:
% rlwrap --prompt-colour='1;34' mysql
Note: contrary to convention, rlwrap spells colour with a U.
If you want everything in colour, check out acoc - Arbitrary Command Output Colourer. Not sure if it works with interactive programs, you might need to extend it or write your own.
Mysql text client is really basic, if you need something more advanced, you could try MySQL Query Browser, which is a GUI client.
Look up the program GRC on MacPorts.
I'm currently working on getting it running to colorize all of my terminal output. It uses regex to parse everything, so it really comes down to how much regex do you feel like writing.
For colorizing everything you need nothing but a simple echo.
Since mysql has:
system (\!) Execute a system shell command.
you can easily:
But if you want only the prompt be in color use rlwrap
And if you want to colorize the result of command you can use grc
It is a python script that I think read the underline stdout, stderr and then colorize it. You can configure it. And since it uses regex to match the result, in configure file you should write regex
More detail about ANSI color:
Add this to your ~/.profile [or ~/.bashrc]
export MYSQL_PS1="$(echo -e '\033[1;32mmysql \d> \033[0m')"