Ask the Expert

Silencing MySQL's beep

My question may be so easy for you, but I am really eager to solve it: When I make a mistake in SQL or other things in the command line, it BEEPs! How can I configure MySQL to not make such a loud beep?

Requires Free Membership to View

Sometimes the answer is easier than you think! When you start the mysql command-line client, add the --no-beep option!

Other interesting options when using the mysql client include the following:

  • If you want vertically formatted ouput, add G to the end of a query instead of a semicolon:
    mysql> SELECT * FROM city LIMIT 1;
    | ID | Name  | Country | District | Population |
    |  1 | Kabul | AFG     | Kabol    |    1780000 |
    1 row in set (0.00 sec)
    mysql> SELECT * FROM city LIMIT 1G
    *************************** 1. row ***************************
           ID: 1
         Name: Kabul
      Country: AFG
     District: Kabol
    Population: 1780000
    1 row in set (0.00 sec)
  • Use the --compress option to compress the communications between client and server.
  • Use the \T option to turn on logging. All MySQL output that is sent to the screen will also be sent to the logfile you specify, and use \t to turn logging off again:
    mysql> \T c:log.txt
    Logging to file 'c:log.txt'
    mysql> \t
    Outfile disabled.

This was first published in November 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: