Showing entries 1 to 1
Displaying posts with tag: mysql prompts (reset)
Prompt prompts

Ever wonder how long that MySQL statement took to run? Or what pace those scripts you run from cron take to run at night? You can change the prompt on the MySQL command-line tool to show user name, time, current database or many other useful facts.



>mysql foo
mysql> prompt \R:\m:\s>
PROMPT set to '\R:\m:\s>'
14:11:16>SHOW TABLES;
+------+
| foo |
| bar |
+------+
2 rows in set (0.01 sec)

14:12:12>



I find this quiet handy in scripts that I run late at night. It is also good when running a complex statement that will consume clock time so that I can tell when it finished. Not exactly awe inspiring but a quite handy 'trick'.



Details are here half way down the page.

Showing entries 1 to 1