Rock? Probably Tony Levin in his first King Crimson stint. Although for sheer rock solid groove I think John Paul Jones is seriously underrated.
Jazz? You've got a whole raft. People have rightly mentioned Pastorius, who redefined what the bass could actually do within a group. Interestingly, not a few musicians pick out Alfonso Johnson as the best bassist Weather Report ever had. Again, for sheer groove listen to his superb work on Sweetnighter and Mysterious Traveller. Then there's Stanley Clarke. Not exactly a slouch. On acoustic bass, I'm very fond of Scott LaFaro's work with Bill Evans.
It's such a rich instrument...
(In my heart I am a bassist. It's just the fingers that don't follow).
Oh. Wild card shout for Bach, who wrote some of the best bass lines in any category of music.