This article explains the battle in detail, as well as recounting how then James Glasgow Farragut became connected to the Porter family and the U.S. Navy.
I must take issue with some of the details written by the distinguished author, however. When James Glasgow Farragut became a midshipman in December of 1810, he was nine years old, not eight. At that time, David Porter was a commander in the Navy. He was promoted to captain in July of 1812, while he and his adopted son were on their epic journey in the frigate ESSEX. In addition, while Admiral Farragut and Admiral Franklin Buchanan had spent over 100 years combined as sailors, it was not all spent at sea. Their service was divided about equally on land and at sea.
In 1814, the journey of Captain Porter and Midshipman Farragut ended when the ESSEX engaged in a losing battle with two British warships, and was captured. Young Farragut experienced the horrors of combat at a very early age, and it filled him with a lifelong desire to get even with the British, which he was never in a position to do. Once during the Civil War he said that he would have much preferred to lay his ship next to a British man of war than to fight his own people.
To me, Admiral Farragut is one of the most interesting figures in the Civil War. Those who would like to learn a great deal about him would do well to study this biography of him written by the famous author of naval doctrine, Alfred Thayer Mahan. It can be read in its entirely online.
Most sources that I have seen say that Midshipman Farragut changed his name in 1812, while on the ESSEX.
After the ESSEX was captured, young Farragut returned to the northeast as a paroled prisoner of war. He was exchanged in November of 1814, and assigned to another ship, but the war ended before the ship sailed. By then, he was definately known as: "David."
The source above is well done, but the statement that Admiral Farragut was the only officer to receive the Thanks of Congress twice is incorrect. Actually, General Sherman was the only officer to receive the Thanks of Congress twice during the war.
Admiral Farragut received the Thanks of Congress for the Battle of New Orleans in 1862 and the Battle of Mobile Bay in 1864, but the second award was not approved until 1866.