Wednesday, September 30, 2015

How to backup a single MySQL database?

  1. Open the Command Prompt (Windows)/Terminal (Linux)
  2. Type the following command:

    mysqldump -u {username} -p{password} -h {host} {databaseName} > {backup-name}.sql
{username} is the login that has access to connect to the database
{password} is the login's password
{host} is the server name where it is the database
{databaseName} is the database name
{backup-name} is the name back up file name

Example:

I want to backup the BAZINGA database located at the TheBigBangTheory host with the user name Sheldon and password Cooper and save it on Meemaw.sql  file.

mysqldump -u Sheldon -pCooper -h TheBigBangTheory BAZINGA > Meemaw.sql

Source: https://www.linode.com/docs/databases/mysql/back-up-your-mysql-databases

Friday, September 18, 2015

Thursday, September 17, 2015

How to do foreach in Java

List<String> collection = new ArrayList<String>();

collection.add("Hello");
collection.add("World");

for(String item:collection)
{
System.out.println(item);
}

Wednesday, September 16, 2015

How to check how much RAM you have installed in Linux


  1. Open terminal
  2. Type

    free -mt
This command will output the memory in megabytes

How to move the Eclipse workspace to another folder


  1. Close Eclipse
  2. Open the OS file manager (Example: Windows Explorer for Windows and Nautilus for Linux)
  3. Move the workspace folder to the new location
  4. Open Eclipse
  5. In the menu bar, click File
  6. Mouse over Switch Workspace
  7. Click Other...
  8. Select the new workspace folder location
  9. Click OK