Problem solve Get help with specific problems with your technologies, process and projects.

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?

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.

Dig Deeper on Linux servers

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.