How to take backup of database and restore using command

How to take backup of database and restore using command


I was involved in working on databases using MySQL and recently i was required to re-create DB on different machine. So either you can create it from scratch or take the backup of DB from one machine and restore it on other machine which saves time. Also its a practice to take backup on regular basis.
To to this we can use below command.


To take DB backup
=============================================
-> mysqldump database_name > database_name.sql

**Make sure to keep the db name same.



To Restore DB backup
=============================================
->mysql database_name < database_name.sql


You will have the DB ready on new Box/machine in few minutes with same replica.


That's it.


How to upgrade JAVA version in AWS Linux instance

How to upgrade JAVA version in AWS Linux instance


On AWS EC2 instance(Linux) if you ever want to upgrade JAVA version to latest ,you can do it using following command.

Once the instance (EC2 linux) is up and running , connect remotely and logged in.

1. Check the version of JAVA using :
 -> java -version

2. Uninstall the Older version using : [in my case its java-1.7.0-openjdk ]
-> sudo yum remove java-1.7.0-openjdk

3. Install the Newer version of JAVA using :
-> sudo yum install java-1.8.0


To make sure its installed correctly - check the version again using command given in Step1 above.


Thats it...

Android : How to connect your Android device over Wifi using ADB command for App debugging

How to connect your Android device over Wi-Fi using ADB command Sometimes it requires to connect your Android dev...