Tuesday, October 15, 2019

Unable to install MySQL server on Windows 10 - FIXED

Recently I was facing a weird error while trying to install MySQL Community server on a Windows 10 system.

Every time I start the MySQL Community installer and select MySQL server and try to install, It used to successfully download the setup file from internet but at the end it used to fail.

Usually progress percent used to go from 0 to 100% then again used to restart from 0% and used to go till 50% and then it used to show the error message as installation failed.

I googled out a lot and found many places which suggested to install both Microsoft Visual c++ redistributable for both x86 and x64. My system was a 64 bit system, I installed both the visuall c++ distribution but none of them worked even after rebooting system after every install.

What finally worked was this:

1. I wantedly started MySQL installer web and tried installing MySQL server  (version 8.0, earlier had tried 5.7 also).

2. Wantedly waited for the installation to fail.

4. Went to the folder C:\ProgramData\MySQL Installer for Windows\Product Cache. (ProgramData folder might be hidden, enable visibility of hidden file)

5. Selected the .exe file with name mysql-8.0.17-win64.exe and tried installing it again by double clicking that file.

6. But during this time at the time of selection, I selected custom install and excluded the "Server Data Files" while the dialog box was showing which all modules to install.

7. This time it installed well.

8. Once the installation completed. I went back to MySQL installer. Now MySQL server 8.0.17 was showing up. I clicked on reconfigure and went ahead with initial configuration and password setup of the MySQL server.

Hope this helps you save your infinite search to find solution to this known MySQL bug..

I am thankful to Peter (https://bugs.mysql.com/bug.php?id=89066) who posted this solution which I found after two days of rigorous search.

Sunday, April 21, 2019

How to remove last commit from Git

Sometimes while committing codes to Git, we end up doing wrong commits and hence would like to reverse the commit.

Here are the 3 commands which would be handy:

These commands are applicable when you are doing reverse commits in non-master branch:
Open Git Bash and type the following command:

1. git reset HEAD^               

This will remove the recent last commit from the active branch.

2. git push origin :branch_name 
This command would delete the branch from remote location of the git.

3. git push origin branch_name  

Now this command will push all the commits from your local to remove by creating the deleted branch again but without the last commit since you deleted it in local git.

If you want to reverse the commit in Master branch, it is little different, Here in non-master branch we deleted the whole branch in remote, but since Master branch is default branch and cannot be deleted, so the trick is little different. If you want to reverse your commit in Master branch, you can 
refer the below reference link from Stackoverflow: 

Tuesday, January 15, 2019

Important SQL Query - Ready Reckoner

1. For Displaying records:

select * from [table_name];

select * from [table_name] where [field_name]='1';

2. Deleting specific records:

delete from [table_name] where [field_name]>0;

3. Insert Records

insert into [table_name] (field1, field2, field3,...) values (value1, value2, value3,...);

insert into [table_name] values (value1, value2, value3,...);

4. Update Records:

update [table_name] set [field1]=[new_value] where [field2]="1";

Friday, January 4, 2019

Enable offline mode to improve Android Studio speed

If you are starting with Android Studio or have upgraded to the newer version of Android studio, you might experience, the IDE sometimes gets stuck or freezes during the process of compilation.

This might be probably the gradle is working online and trying to download. There are many ways available to boost up the performance of Android Studio, one of them is by enabling Offline Work Mode.

You can achieve significant performance boost by enabling offline mode in Android Studio. Here are the steps to do that:

Please note, I am currently using Android Studio 3.2.1

1. Go to File> Settings.

2. In Settings dialog box, Go to Build, Execution and Deployment section. Under that go to Gradle section.

3. Check the box which mentions "Offline Work" as shown in the below image and click on Apply button.

Gradle Offline Work

4. Next go little below under Compiler section and check for the text input area which mentions "Command-line Options.

5. In the command-line Options type, "--offline" and click on "Apply" button and finally click on "OK" button to save all changes.

Now you should see certain improvement in the performance of android studio.

How to get MySQL Shell in Ubuntu/Linux

 Often, we install MySQL Server in Ubuntu or Linux machines and then we tend to forget how to login to MySQL shell. This may happen if we ra...