Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I connect from the commandline, is it possible to change the welcome message displayed by MySQL?

The current message displays the version, Oracle copyright, etc.

I would also like to display a banner.

share|improve this question

2 Answers 2

Add following in your my.cnf

[mysql]
silent

and try logon trigger to print the banner via "system echo 'my custom message'" . With some more creativity, you can customize per user logon message.

share|improve this answer

At the very least, you could suppress the welcome message using the -s or --silent option

# mysql -u... -p -s

It will immediately present the mysql prompt

mysql>

Perhaps, you may want to create a shell script with the custom welcome or banner that displays prior to logging into mysql.

If you are a little more daring, you could download the source, locate and change the welcome message, recompile all binaries, and install. If you are that daring, have fun with that one.

share|improve this answer
    
The -s option is smart, but removes the boundaries (signs |, + and -) when executing SELECT-statements. If on *nix; one option is to use an alias and echo a message prior booting mysql. –  mira_mayhem Mar 19 at 12:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.