Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 7

Displaying posts with tag: cli (reset)

Diagnosing problems with SQL imports
+0 Vote Up -0Vote Down

Importing a text file containing a list of SQL commands into MySQL is a straightforward task. All you need to do is simply feed the file contents through pipe into MySQL command line client. For example: mysql app_production .

The reasons for doing such imports can be very different - restoring MySQL backups created with mysqldump, manually replaying binary log events or performing database migrations during software roll-outs.

While the task is simple, the import may not end successfully and when this happens, how to tell what the problem was?

MySQL errors

Whenever database hits an error, MySQL produces an error message that describes the problem and the import process stops immediately. If the message is not clear enough, you can always refer to the reported line number, which is the line number inside the source SQL file. This

  [Read more...]
MySQL CLI Hidden Gems
+0 Vote Up -0Vote Down

I am sure any of you that have used MySQL in the past have used the MySQL Command-Line tool (CLI). Here we will explore some of the less used CLI features that you may or may not be aware of.

Edit: In hindsight I should of called this post something like MySQL CLI Hiding Gems or Lesser Known Gems. These tools aren’t strictly hidden just not often used or mentioned.

System commands
You can use the system command to exectute shell commands without leaving the CLI


mysql> system whoami
sam
mysql> system echo "Hello World"
Hello World
mysql> system uname
Darwin

The same can be done with \! instead of system.

Logging to file
The tee (\T) command can be used to specify an output file to log CLI output to.










  [Read more...]
Tip: how to save 10 minutes a day?
+1 Vote Up -0Vote Down

For any person actively working with MySQL databases on the command line level, logging in, logging out for a few moments, and then logging in again, all repeated many times, not only eventually becomes annoying, especially with passwords that aren’t easy to type, but it also can take a lot of time over the course of a day. For a long time I’ve been relaying on something that allows me to avoid most of this effort while working. The solution is of course not to log out unless you actually want to.

Linux, BSD and Solaris all allow suspending a running task and resuming its execution at a later time. This can be used to temporarily exit MySQL client without having it to leave the database.

When inside MySQL, you can press Ctrl+Z to suspend the client program and return to the system shell. You will be able to

  [Read more...]
Setting up Amazon Web Services
+0 Vote Up -0Vote Down

This tutorial will help you register and get ready to use Amazon Web Service (AWS). AWS provides a free tier so it is possible to use these services at ZERO cost.

These instructions are used by the Effective MySQL: Backup and Recovery book examples.

Step 1: Registration

  • Goto AWS site
  • Register email address
  • Enter Login Credentials
  • Enter Contact Information
  • Enter Credit Card details (while this is required, provided you follow free guidelines you will not be charged)
  • Identity verification by Telephone
  • Activation of account
  • Screenshots

      [Read more...]

    CLI, Roller, Jersey, JavaOne... and More GlassFish News - April 27th, 2010
    Employee_Team +0 Vote Up -0Vote Down

    Install and Run Apache Roller 4.01 on GlassFish and OpenSolaris
    Dave Koelmeyer has posted Detailed Instructions on how to install Apache Roller 4.01 on GlassFish v2.1 using MySQL 5.1 for storage.  He uses OpenSolaris snv_134, the subject of a tea-leaf-reading thread.

    Slides and Code Samples on Jersey and JAX-RS
    The Slides and code from Paul Sandoz's presentation at Presentation at AlpesJug on Jersey, JAX-RS and Atmosphere are now 


      [Read more...]
    How to get colored output from ‘ls’ on Solaris10
    +0 Vote Up -3Vote Down

    For all of those linux users out there that have moved over to, or tried out, Solaris10 or OpenSolaris because they heard the tales of how MySQL is faster on Solaris… or perhaps you wanted to learn how to use Sol10 for the great features of Zones or the ZFS filesystem? Regardless of why you’re on it you are probably wondering why Linux has colored output of filenames and directories but Solaris does not. The question of ‘why?’ isn’t important, but how to enable colors is. It’s very simple, and here’s how I fixed it. This is a result of digging through multiple semi-related links on Google.

  • Download all packages from SunFreeware.com
    • dependency: libintl-3.4.0-sol10-x86-local
    • dependency: libiconv-1.13.1-sol10-x86-local
    • dependency: gmp-4.2.1-sol10-x86-local
    • dependency: gcc-3.4.6-sol10-x86-local or
      [Read more...]
  • Save time and energy: How to …
    +0 Vote Up -0Vote Down

    Save time and energy: How to:

    Listening to “Highway to Hell” in an Oxford University computer lab on a sunday afternoon writing a MySQL blog can be legitimally defined by some as sick but thats what a geek calls a relaxing yet productive sunday afternoon.

    For the sake of all those CLI ambassadors like myself, I wanted to share a couple of tips and tricks I use quite often when doing my mysql db administration work / scripting. I strongly suggest any mysql dba / dev use CLI simply because thats the one thing you should always have on any machine on which mysql is installed, be it Unix, Linux, Mac, Microsoft or whatever platform you are using.

    Cancelling a query you are typing without exiting to the terminal:
    `\c` – How many times you ended up hitting `CTRL+C` (default process kill in most OSes) in order to cancel a command, finding

      [Read more...]
    Showing entries 1 to 7

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.