Opening MySQL Console

If you are using MySQL on your development machine or in production environment, you may want to check some tables from time to time. The commands to open MySQL console are repeatable and can be created as a task in TaskTips Console.

Please see the following examples. You can create similar tasks for opening console of Oracle DB, Postgres SQL or Mongo DB etc., as long as you can imagine how you can leverage TaskTips to index the repeatable tasks.

Example #1: Open MySQL on Local Machine

Task Type:

Terminal

Task Name:

Open MySQL console on local machine

Task Instructions:

mysql -h 127.0.0.1 -u root \
    --password=xxxxxx \
    --default-character-set=utf8 -A
show databases;

Search Key:

mysql (or empty)

Safe Mode: Disabled

When you execute this task, the two commands specified in Task Instructions field will be input and executed in your terminal window automatically. What you will get is a list of database names coming from your local MySQL database. You can then continue your work with this MySQL database from the current terminal window.

Example #2: Open MySQL console of TaskTips prod

Task Type:

Terminal

Task Name:

Open MySQL console of TaskTips prod

Task Instructions:

ssh developer1@task.tips
sudo docker exec -it db bash
mysql -h 127.0.0.1 -u root \
    --password=xxxxxx \
    --default-character-set=utf8 -A
use task_tips
show tables;

Search Key:

mysql (or empty)

Safe Mode: Disabled

Project:

TaskTips

When you execute this task, the five commands specified in Task Instructions field will be input and executed in your terminal window automatically. What you will get is a list of database tables coming from the production MySQL database. You can then continue your work with this MySQL database from the current terminal window.

Summary

With this kind of tasks, you don't need to input the commands manually anymore. Instead, we simply search the task and execute it.

Please keep in mind that you can create tasks with any commands.