George Harrison was not only the quietest Beatle, he was the funniest. In the late 1990s, when he was working on a “Yellow Submarine” remix at Abbey Road Studios, Mel Gibson was downstairs recording music for “The Patriot.” He asked to meet the Beatle.

Gibson walked into the studio and went to shake hands with Harrison. The guitarist looked slightly pained and said, “Oh, I thought they said Mel Brooks.” Gibson was crushed, and Harrison quickly laughed and told him he was only kidding.

The story comes from a new book by Ken Scott, a longtime rock ’n’ roll engineer and one of only five who worked with the Fab Four. “Abbey Road to Ziggy Stardust” (Alfred Music Publishing), out June 8, traces Scott’s career from starting in the tape library at Abbey Road as a teenager to recording David Bowie, Supertramp, Elton John and dozens more.

But it is Scott’s long association with The Beatles that is likely to interest readers most. He began engineering the group on 1967’s “Magical Mystery Tour” while just 20 years old, in part, because most of the old-timers hated working with The Beatles because of their erratic hours. They were scheduled to show up at 2:30 p.m. every day, but some days, inexplicably failed to appear. Scott quickly learned that if there were teenage girls gathered outside the studio, The Beatles would be turning up.

The recording process was primitive, done on a simple four-track machine. On “I Am the Walrus,” for example, John Lennon wanted to add some noise to the end of the song, so Ringo Starr was given a radio and asked to scan around to different stations. He had to do this live as the song was being mixed, because a track was not available to record on. He ended up finding a performance of “King Lear” from the BBC, which you hear as the song begins to fade.

Scott writes that the making of “The Beatles” (a k a “The White Album”) wasn’t nearly as contentious as has been written. The members fought, but they also had good times. One day, Scott spotted a woman in an apartment across the way exercising naked. The next day, Ringo showed up to record carrying a pair of binoculars.

The group was known for rolling with recording mistakes. When Scott accidentally erased a snare double track from the last half of “Glass Onion,” the band left it. On “Long, Long, Long,” Paul McCartney had left a bottle of wine on top of an organ speaker cabinet, which rattled when he played. You can hear it on the finished song. The airplane sound effect at the end of “Back in the USSR” sounds distorted because the tape had nearly worn out.

Scott also worked on Lou Reed’s “Walk on the Wild Side.” The famous bass line from the song was created by doubling the first line with an electric bass, and it only came about because the player, Herbie Flowers, wanted to get paid twice under union rules.

Scott did occasionally enjoy the rock ’n’ roll lifestyle. In the 1980s, while working with the band Missing Persons, he threw a post-concert party at his LA pad that quickly grew out of control. The cops showed up, but when they discovered Missing Persons were there, they asked for T-shirts and autographs, turned up the music even louder, then left. The party only broke up after an ambulance had to be called because one male guest got his delicates stuck in a Jacuzzi jet.

The most luxurious experience of Scott’s career came working with Duran Duran on 1995’s “Thank You.” The band stayed in five-star hotels, flew first-class and spared no expense in the recording process. They once jetted Scott from LA to London to lay down a single acoustic track. It took all of 15 minutes. What Scott found strangest, however, was that lead singer Simon Le Bon, for reasons unknown, demanded to be addressed as “Charlie” while in the studio.

Sorry, Charlie. That’s weird.

reed.tucker@nypost.com