Secrets of the MySQL Client Command Line

Inserting Batch Data

Suppose you're writing an e-commerce application that will be used to sell a wide variety of products. It makes sense to categorize these products; therefore, you'll be using a table named categories to manage the category names:

Disable the Annoying Error Beep

Related Articles

If you've ever seen the movie Dumb and Dumber, you might recall the scene where Lloyd (Jim Carrey) and Harry (Jeff Daniels) attempt to outdo each other in terms of who can make the most annoying sound in the world. The MySQL client's obnoxious error beep would have fared quite well in such a competition. If you're not familiar with it, just execute a malformed query from within the client for an earful. Although it has nothing to do with efficiency, I couldn't pass up the opportunity to work this tip for disabling it into this tutorial. To temporarily disable the beep, pass --no-beep along when logging into the server:

%>mysql -u root -p --no-beep

To permanently disable this annoyance, add no-beep to the [client] section of your .my.cnf file.

Conclusion

I hope this compilation of MySQL client "secrets" helps you use this powerful tool much more efficiently! If you'd like to share a tip, email me at jasonATwjgilmore.com!