Wednesday, July 26, 2017

MySQL Console Pops Up Unexpectedly

MySQL database server provides an easy to implement and uses ANSI SQL syntax with wide implementation for many programming platforms. It is still open source licensed for the Community Edition as GPL (see details at mysql.com).

Current versions of MySQL Community Edition is available on Red Hat 6+, Centos 6+ and MS Window 10, for following versions;

  • MySQL 5.6 GA on 5.2.2013
  • MySQL 5.7 GA on 21.10.2015

Both versions are known to support current SQL standards, being SQL:2008.

Since using MySQL Community Edition version 5.6.21, something strange has been happening every midnight. A DOS like prompt pops up and very quickly does "something", which does NOT really allow me the time to read the messages and then it goes away (disappears). On one occasion I managed to capture that screen as the database it was trying to reach was not connected and here is how that screen looks like.


Apparently it was updating the MySQL catalogue, pretty harmless. The problem that I can see;
  • Takes up additional processing which is not good when I am running emulators or CPU intensive work
  • Distracts any on going work, such as when preparing documentation
  • Disrupts desktop on-going recordings
  • Disrupts benchmark operations

One could either disable the update process or assign it to another pre-defined time. On MS Windows 10, here are the steps to do either.

Step 1: Start MySQL Installer

Click the MS Windows Start and type; mysql installer
Click the Desktop App that appears. An upgrade my be required, proceed with the upgrade.


Step 2:  Edit Installer Options

In the installer option, click the Configure icon (Looks like a wrench).



  1. To disable the automatic catalog update; Uncheck "Should MySQL Installer update its catalog periodically?"
  2. To change the update time; Select a new time in "What time?" dropdown list.

Click Close.

Done.

Friday, July 14, 2017

Source code revision control with Git


Version control system is used to manage versions of files and is used widely with programming source codes. Common examples are SVN and Git.

Here is an example of the using GIT with Heroku (Working with GIT2). It demonstrates the git command for;
  • clone
  • branch
  • checkout
  • commit
  • status

Basic commands to manage a local version control repository

Typical process to prepare a folder where files are to be tracked/staged uses the commands init, status and add. It would be good to have created a folder with 4 or 5 files and try out the following commands.
 # Initialise Git repository   
  $ git init   
     
  # Identify status and which files are being track or untracked.   
  $ git status   
     
  # Add all files to the repository   
  $ git add .  
   
 # Identify files are being track as staged  
  $ git status   

At this time, a folder to manage the repository is created with the name ".git". Have a look at content of the files in this folder.

Filename: .git/HEAD
ref: refs/heads/master

Filename: .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly

Filename: .git/description
Unnamed repository; edit this file 'description' to name the repository.


To remove a file from being tracked.
 # Remove a file from list of staged files  
 $ git rm --cached somefile.txt.  

Process to place files into the repository.
 # Commit files to repository  
 $ git commit -m "Place comments here"  
   
 $ git status  

Retrieve tracked file from the repository. The latest thats found in the repository, that is.
 # Checkout a file from the repository  
 $ git checkout programming.txt  
   
 $ git status  

Cache and other files that should not be kept in the repository or tracked, can be listed in a file ".gitignore" within that folder. Example to ignore the folder "temp" and file "nofile.txt".

Filename: .gitignore
/temp
nofile.txt

end

Blog Archive