Showing entries 1 to 10 of 13
3 Older Entries »
Displaying posts with tag: cli (reset)
MySQL Shell with Command Completion

MySQL ShellCLI Interfaces are usually boring, ASCII-ish functional interfaces that are as about as exciting as paint drying or end user license agreements for your rice steamer. They get the job done but no excitement. The new MySQL Shell (mysqlsh instead of mysql at the command line is a great new tool but like its predecessor it is not exactly visually dynamic.

Until Now.

At labs.mysql.com there is a new version of the MySQL Shell that adds some new functionality and some visual enticements. I was in a session at Oracle OpenWorld and was impressed by not only the visually stunning upgrade but by the fact that we now get command auto-completion!

You can login as you did with the old shell but then you see that little bit …

[Read more]
How to Configure Aurora RDS Parameters

In this blog post, we’ll look at some tips on how to configure Aurora RDS parameters.

I was recently deploying a few Aurora RDS instances, a process very similar to configuring a regular RDS instance. I noticed a few minor differences in the way you configure Aurora RDS parameters, and very few articles on how the commands should be structured (for RDS as well as Aurora). The only real literature available is the official Amazon RDS documentation.

This blog provides a concise “how-to” guide to quickly change Aurora RDS parameters using the AWS CLI. Aurora retains the parameter group model introduced with RDS, with new instances having the default read only parameter groups. For a new instance, you need to create and allocate a new parameter group (this requires a DB reboot). After that, you can apply changes to …

[Read more]
My MySQL command prompt

Earlier this week we had a discussion with fellow DBAs about our mysql prompts, and at the end of the day it showed up, that a lot of us hit the same problem. The problem is, that when you set up your mysql prompt then ‘\h’ will be resolved to ‘localhost’ when you connect locally […]

My MySQL command prompt

Earlier this week we had a discussion with fellow DBAs about our mysql prompts, and at the end of the day it showed up, that a lot of us hit the same problem. The problem is, that when you set up your mysql prompt then ‘\h’ will be resolved to ‘localhost’ when you connect locally […]

The way I like to compile my Go programs – Makefile

I was on the quest of searching the Holy Grail of Go programming, and I found something, which I doubt that it is, but close enough – for the first sight.

I have several problems with GO, first, that I write my code on an OSX box, and I’ll run the programs on Linux hosts, so I have to solve the cross compilation; my second problem with Go, that I don’t really like the “There is a GO project folder, and all the GO projects are relying on” approach. It makes using GitHub painful.

The first problem of mine is easily achievable since GO 1.5: we only need a GOOS environment variable and we can compile to different OS-es (see more at Dave Cheney: http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5) easily.

The second problem is easily solvable too, just we have to start using the GOPATH variable for every GO project we have.

I don’t really want to use any external dependencies, so I decided to …

[Read more]
My work environment

I was thinking if my work environment would be interesting or not, but I decided ‘yes’ – because I always like reading about others work env.

I am working with Linux/UNIX for more than 15 years now, and I have tried a lot of cool tools, but at the end, I always found myself using the same apps in terminal.

I like the unix philosophy about Do One Thing and Do It Well. I never really use big, bloated software, I like to use my editor for editing files, and my git client to use git. That’s simple.

Normally I work from a mac, but I have an installed linux based backup environment too, on a remote server which can be accessed via ssh.

The basic tool for me is iTerm2. The main features I use are split pane (cmd+D vertical, cmd+shift+D horiontal) and broadcast input (cmd+shift+I). I also like that it can be switched to fullscreen with cmd+enter. In …

[Read more]
Diagnosing problems with SQL imports

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 < dump.sql.

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 way you can locate the precise command or query that …

[Read more]
MySQL CLI Hidden Gems

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?

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 bring the database client back at any time by running fg command …

[Read more]
Setting up Amazon Web Services

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

  1. Goto AWS site
  2. Register email address
  3. Enter Login Credentials
  4. Enter Contact Information
  5. Enter Credit Card details (while this is required, provided you follow free guidelines you will not be charged)
  6. Identity verification by Telephone
  7. Activation of account

Screenshots

[Read more]
Showing entries 1 to 10 of 13
3 Older Entries »