Q

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.
    

This was first published in November 2004
This Content Component encountered an error

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.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchDataCenter

SearchServerVirtualization

SearchCloudComputing

SearchEnterpriseDesktop

Close